Is it better having one .resx file with all messages (so that all the namespaces depends on it) or splitting into several files, one for namespace? What do you suggest?
Asked
Active
Viewed 47 times
0
-
If messages are string resources (I'm not .NET dev, just guessing and applying experience from Android), it depends whether you reuse them by the same key in multiple namespaces/modules. If your keys are namespace specific already, splitting them may make sense, although for localization it is often better to have rather one file (to distribute to translators, sync, etc). If you share keys (has its own drawbacks in case some namespace needs slightly different wording, sometimes happens), then one file looks as natural solution. – Ped7g Aug 21 '17 at 10:40
-
I think so too. Keys are not shared between namespaces. The point is exactly this: easy of translation (one file) vs not having inter-namespaces dependencies: when I visualize a dependency graph for code analysis, it's really annoying seeing almost everything pointing to that 'message file' and it's containig namespace. Thanks. – Paul B. Aug 21 '17 at 10:46
-
Maybe it's possible to create completely separate namespace for only localized strings, and then exclude that from code analysis of dependencies, but again I have no idea about particular .net tools, maybe that's not even possible, or very cumbersome to set up and maintain. There even exists specialized solutions for localization, which may be capable to gather all files from different namespaces into single point for translators and then split the results back into original files (we have something custom for Android, but it serves back single big zip file with everything, as that WFM). – Ped7g Aug 21 '17 at 11:05