Resource files, variables usage

This is a place to discuss how to adapt mojoPortal to the needs of different cultures. Before asking questions here please first review the localization documentation.

This thread is closed to new posts. You must sign in to post in the forums.
8/20/2008 8:59:58 AM
Total Posts 20

Resource files, variables usage

Hello guys,


I have been translating mojoPortal to Spanish, Spains' tranalation (I believe that is .es.resx). Before I translate an app that uses a resource file I usually get the default language and sort it using the values. That way I can make sure that if there is more than one variable that uses the same value I use the same value in the translation. My findigs reveal that in the resource file there are 1396 variables but there are less values that variables, the most obvious examples are:

"Url:" => 4 variables

"Update" => 18 variables

"Total Posts:" =>4 variables

"Title:" => 7 varibles

"Title" => 5 variables

"Subject:" => 5 variables

"Sign in" => 4 variables

"Setting" => 4 variables

"Security" => 5 variables

"Save" => 14 variables

"Refresh" => 5 variables

"Name" => 5 variables

"Edit" => 22 variables

"Delete this item" => 9 variables

"Delete" => 30 variables

"Cancel" => 32 variables

Just taking into account the above examples 173 variables are being used for 16 different values. I cannot make any statement about if using so many variables for the same values makes the system memory usage be worse than using 16 variables.

In my opinion it would be better to merge variables that use the same value to a single variable, for example use a variable called CancelLabel for any label or button that cancles an action. I can think of two reasons to support my reasoning:

1) it's easier to get translators to work on them.

2) it's easier to have consistant translation and easier to upgrade. For instance, in version 2 of an application, "Tom" may need to be renamed to "Jerry". It's easier to replace in fewer places. This can also reduce the problems that one word is translated differently at different places. (However, if the word DOES have different meanings in different context, multiple entries should be created).

I have a table with all the variables that have the same values which I can pass and can be used to refactor the code. I would love to hear other people thoughs.





8/20/2008 9:16:59 AM
Total Posts 18439

Re: Resource files, variables usage

Hi Mandel,

While agree it would be easier to maintain and to translate if we reduced the keys, however for several reasons I don't want to re-factor that right now.

While it is true that many features use the same labels for update and cancel buttons, they are different buttons in different places and I don't rule out the possibility that in some cultures it may be desireable to translate them differently in different places due to their usage context. If we combine them then its easier to maintain but this is no longer possible.

Sometime in the near future I plan some other re-factoring that will also require re-factoring resource files. What I plan to do is make it possible to have a minimal installation of mojoportal with no features except the html module. To do that I will first be creating a set of projects:

mojoPortal.Features.Data (5 versions)

then I will move the poll and survey into those projects and implement the missing data layers for those features

after that I will move most of the other features like Blog, Forums, Links etc out of the main projects and into this set of projects. At that time my plan is to re-factor the resources into per feature files like BlogResources.resx, ForumResources.Resx etc

So, for the time being I would prefer if you can just tranlsate them as they are. You can sort them by value and update all the same values with the same transalation.



8/20/2008 9:22:05 AM
Total Posts 20

Re: Resource files, variables usage



Sounds great. I did not know your future plans and I agree that re-factoring rigth now if you are going to divide the projects and resource files would be a waste of time. I hopefully will have the translation done by tom morning.




You must sign in to post in the forums. This thread is closed to new posts.