ml.ml_string() return null for "new" strings..? (and a few other things)
Hi again - and sorry about all the posts.. We are making a huge localization review of current strings used, added new strings and adding new languages.
Some strings return null (I estimate the "last" 50% of the strings added is having this issue).
Looking at the code, I can see resource files for all my languages multiple places (simplified example without all local resources):
- /{projectname}/App_LocalResources/{filename}.aspx.{language}.resx
- /{projectname}/App_GlobalResources/MultiLang.{language}.resx
- /{projectname}/MultiLang.{language}.resx
Let me explain what I see in each "type" of file:
- Contains only the strings required for the file (no strings is missing)
- Should contain all strings, but is missing (some) of the "new" strings
- Contains all strings and looks up to date
Based on my own little humble assessment, it seems like either (3) should have replaced (2) OR "ml" class should get the strings from (3) instead of (2).
(3) is new to me - and something I didn't have in previous versions of MultiLang (at least I think so). Before this translation round, I updated the tool to latest version. I changed translation scope to solution scope (from project scope) and I've added both new languages and new strings.
I currently made a hack to avoid errors in my UI where new strings is failing, so I'm still being able to display "original string" instead of whole page is throwing an exception:
public static string ml_string ( int StringID, string Text ) { // Resource IDs are now prefixed with "_" var res = ResMgr.GetString ( "_" + StringID.ToString() ) ; //DontTranslate if (res == null) res = Text; //TODO: FIX THIS HACK !!!!! return res; }
------------------------------------------------------------------------
A few other "minor" issues.
- When I add/select a string from e.g. ListItem.Text - it will sometimes add ListItem.Value as well (and that makes no sense). It never makes sense in my solution to translate a ListItem.Value.
- Strings "hidden" (neve to be translated) seems to again sometimes being added in above scenario (Text/Value) and sometimes they are "just" added to the list of "Unused Strings" (making it impossible to clean up the list of "Unused Strings").
- MlString.cs was added to "App_Code", and for "Web Application" this is bad practice ("ml" class will reside in 2 dll files).
- Solution scope is great in theory, but we have multiple solutions to handle same product. It would be a lot better if we could either get a "global compact sql scope" (without polluting the current "global database") or if "solution scope" meant a project was added to solution (and this project could be shared between solutions