Reading label text from .resx files in ASP.NET - asp.net

I am trying to find a way of looping through a .resx file that contains English words and replacing them with the translated equivalent.
I have used a ResXResourceReader to read the file, can anyone help please

You can directly get the text by specify key
String Text = GetLocalResourceObject("yourkey").ToString();

Could you specify from which side do you want to do it? I mean, if it's just for a developer, that can see the code, you can do it easily changing the .resx files, but if you want to design an interface so a user can translate without seeing any code, then I'd do it with LINQ to XML. I can show you if u need examples but answer first.

Related

Save css files using Notepad as Encoding of Ansi or UTF-8?

I'm new at web development and css,
One simple question came into my mind...
I know how to create a css file, but I'm not sure save this Encoding file as ANSI or UTF-8 when I save the file using Notepad?
I'm not sure which one is the best choice.
I searched on the internet, but I didn't find something helpful.
I want to know which one is the best choice for saving the file as css that will not be a problem in the future.
Please take a look at the attach image
Thanks for your helps.
Aattch01, when save a file using windows Notepad
I recommend you save in UTF8
pos if in a futuri your css has characters like
áéíóúñäëïöü, and others more than ANSI would only show an error.
A site where you can find those characters for example is in a content of a pseudelement like:
.menu .spain:after{
content:"España";
}
result UTF8: "España"
result ANSI: "Espa[]a"
Also recommend you to use an editor that gives you more comforts like Atom, which is very simple to use.
Although you may be afraid of it, is a simple editor with many aids to program

SQLite database shows question marks (???) instead of these Unicode characters (தமிழ்)

I imported a CSV file containing Unicode into an SQLite database but instead of seeing the text, all that I see are question marks. Like this, "???". The encoding is UTF-8 (I've mentioned below what happened when I tried UTF-16). The SQLite manager I'm using is DB Browser for SQLite.
This is the Unicode that I typed: தமிழ்
Now, according to this answer in Stackoverflow, SQLite stores text data as Unicode. So the fact that my text is Unicode can't be the problem.
The characters I'm trying to use belong the language Tamil. I'm trying to use it with Unicode. According to Wikipedia, encoding for Tamil is called TACE16. It's a 16-bit Unicode based character encoding.
So then I set the encoding as UTF-16 when I imported the CSV file. But the file doesn't even show up in the database after importing when I do that. But it says import is successful.
Then I tried importing the CSV file with UTF-8 encoding as usual. But after importing I right clicked the row header, selected "Set Encoding" and set it to UTF-16. Now it didn't show question marks but it shows something like Chinese characters. This is what it shows now: 㼿㼿.
I tried setting TACE16 while importing. I also tried setting it manually. But it said it's either an incorrect encoding or it is not supported.
Further searching online didn't turn up anything. Could someone tell me how I can fix this issue? Basically, I want this text "தமிழ்" to show in the SQLite database after importing the CSV file which has the text.
Thank you so much. I would really appreciate your help.
I had similar issue once but in my case the problem were only on the DB software I used to visualize DB tables. Have you tried to retrieve your data from the database? Are they right when you retrieve them?
Anyways if you tell us what tools are you exactly using for doing what it is impossible to find a solution in your specific case.
OK, it turns out the issue was my csv file. I edited it in excel and I guess excel saved it using another encoding. I'm still not sure what's the exact issue but I'll just write about how I fixed it.
I opened Notepad and typed out the data separated by commas. I saved the file with the extensions csv. Here's the important thing. You have to change the encoding to Unicode. There's a drop down menu just left of the save button. Use that. Here's a link to a youtube video that shows you how.
Also, you don't need to type everything in a Notepad. It can get tedious.
Type everything out in Google Spreadsheets and export download it as a CVS file. It works. If you have to use Notepad, type the data in excel, concatenate everything in each row with using a formula, and copy paste it into a notepad. Don't forget to add a comma between each cell info using the formula in excel.

Convert PS (Post Script) File In to Word Using Asp.Net

A Question in my mind Is it possible to convert Postscript(PS) File Into Word(doc) file using Asp.Net? If Yes then how can we resolve it via C# Code.
I don't know of any tool which will convert PostScript to word. Not only that, but you certainly can't reliably do anything except render the whole thing to an image, and isert that as a graphic.
Up to a point you can extract text, what is it you actually want to do ?

Convert RTF to PDF on a rule into Alfresco

I found a link (http://wiki.alfresco.com/wiki/Content_Transformations) that says that i need to create a file named my-transformers-context.xml and put my configurations there to convert RTF to PDF...
There says that some configuration are already configured but this one (RTF to PDF) and some others (DOC to PDF) are not.
By the way i couldn't find how to create this xml with the right configuration to convert the RTF file into a PDF...
Someone already done something like this? or someone know a link that explain how to configure this xml file?
PROBLEM SOLVED!!!!
I don't know if there is a way to say that i've solved the problem... But here it goes the solution...
I saw what Gagravarr said and started looking for configuration of openoffice into alfresco...
There is a file named:
alfresco-global.properties
and there is two variables named:
ooo.exe
and
ooo.enabled
the first one must indicate the path to sopenoffice.exe
and the second one must be equal to true...
ooo.enabled = true
That solve a lot of problema to convert some kind of file to another... like RTF to PDF...
Out of the box, Alfresco should be able to transform a RTF file to a PDF using OpenOffice (direct or JodConverter, depending on if you're on Community or Enterprise)
Assuming you're on a new enough Alfresco, this webscript will tell you what transformations are available from and to RTF:
http://localhost:8080/alfresco/service/mimetypes?mimetype=application/rtf#application/rtf
If that doesn't show you RTF -> PDF, then you need to look at your open office configuration/setup

How to fill an excel template using ASP.NET, VB or C#?

I have a an excel file that has been manually populated, and now needs to be automatically populated using ASP.NET, vb or c#. I've been looking around, and have found examples on how to export a gridview, and data to excel sheet, but not anyway to maintain the format of the original template. I've recently populated a word document using merge fields... does excel have anything similar? Could I break the file down into XML and use that as a template? Any ideas?
Thanks.
Office Writer from soft aritsans will do exactly this. Plus a lot more it is extremely powerful and I have used it to great effect in the past.
The down side is that it is rather expensive!

Resources