...
- Open Sisulizer project file /src/MarineLMS - Sisulizer Translation.slp
- Project → Scan for Changes
- Select All to view all text which can be translated.
- Ctrl + F5 to search for any term you need to translate
- Make any translation/changes you need (see Translate Using Translation Engine)
- Project → Build in Selected Language will generate updated/new translation resx files
- Save the Sisulizer project
- Open MarineLMS solution in Visual Studio
- Include newly created translation resx files (created by Sisulizer) to MarineLMS solution
- The easiest way to find any new resx files created by Sisulizer is to check Sourcetree for uncommitted changes/unstaged files
- In VS, right click resx file and select Include in Project (enable Show All Files in the Solution Explorer to find resx files which are not yet added to the solution)
- Update the newly added resx file's properties (2) to match the values of the default resx file
- Custom Tool: PublicResXFileCodeGenerator
- Custom Tool Namespace: [[namespace from corresponding default resx file]]
- Example: if you added the translation resx file AssessmentSummaryRx.en-US-Disney.resx, there is always a default resx file AssessmentSummaryRx.resx.
- Include newly created translation resx files (created by Sisulizer) to MarineLMS solution
- Commit all resx files and the Sisulizer project files /src/MarineLMS - Sisulizer Translation.slp and /src/MarineLMS - Sisulizer Translation.sds (note: the sds file is updated once Sisulizer is closed)
...
- Download date picker js language file from https://github.com/uxsolutions/bootstrap-datepicker/tree/master/js/locales
- Add the js file to Main.Web \Scripts\libs
- Add reference in Global.asax.cs for the the new js file: bundles.Add(new ScriptBundle("~/Scripts/marinelms.js").Include (i.e. "~/Scripts/libs/bootstrap-datepicker.fr.min.js,")
Use DatePicker in cshtml
(Note: This information is obsolete when the DateInput component is used. Moving forward @Html.DateInput(...) should be used when a date picker is required in a view.)
The date picker classes data-date-format and data-date-language must exist and have the correct values.
...
Handling Resx Files in Visual Studio
The MarineLMS.Web.Main project is currently the only project using resx files and translations with Sisulizer. Resx files in any other VS project are ignored.In In general, you only need to pay attention to default (English) resx files in project MarineLMS.Web.Main. All translation (other language specific) resx files (translations) are maintained by Sisulizer. There are a few exceptions when adding new /or removing resx files (see below for more details). Changes /and updates of names/values within a translation resx file are ignored and overwritten by Sisulizer. Any update to a translation text must be done in Sisulizer instead. Having said that, changes to default resx files must be done in VS solution because Sisulizer uses all default resx files as truth (see 'Information Flow Between VS Solution and Sisulizer with Respect to Resx Files' below).
Sisulizer matches default resx values to allow translation of that value. That means a default resx value is treated as a read-only key by Sisulizer. If a resx file has moved but the values are the same, the translations known by Sisulizer remain and don't have to be translated again. However, if the default resx value changes, that value needs to be translated in Sisulizer as it shows up as a new (unknown) entry.
Important: Please let Stefan (stefan@marinels.com) know about any changes to/new resx files so he can run Sisulizer to update the translation resx files and get new text translated. This will keep Core up to date with any translations.
Information Flow Between VS Solution and Sisulizer with Respect to Resx Files
...
Add new Default Resx File
If you need to add a new resx file needs to be added, only add the default resx file only (i.e. AssessmentSelectorControllerRx.resx). Any translation resx files and their names/values are handled/created by Sisulizer (i.e. AssessmentSelectorControllerRx.fr-CA.resx and AssessmentSelectorControllerRx.en-US-Disney.resx).
Note: Sisulizer generates the translation resx files for any new default resx file. The translation resx files need to be added to the VS solution once (see Update Resx Files and/or Create Translations for Core).
Edit Existing Resx Name/Value
...
- Rename or move all resx files (default and translations) - if the default resx file was renamed, the translation resx files need to be renamed accordingly
- Rename or move default resx file only and delete all their corresponding translation resx files from the VS solution. Sisulizer will generate new translation resx files for the renamed/moved default resx file. However, follow the steps at Update Resx Files and/or Create Translations for Core to re-add the translation resx files to the VS solution again.
Trips and Pitfalls
- Make sure that the default resx file and their translation resx files have the same Custom Tool Namespace and Custom Tool = PublicResXFileCodeGenerator (the designer resx file must exist)
Translate Using Translation Engine
If resx files are moved around previously translations are removed. However, the previous translations are remembered by Sisulizer as Unused Items. They are a good source of translation for any new item.
To tap into the 'background' translation list use Project > Translate Using Translation Engine > Use "Embedded".
Note: there is a notion of Translation Engine which supposed to be a translation list/dictionary. Any 'unused item' could be moved into that translation engine and even edited. I (Stefan) haven't had the time to investigate that. The goal would be to utilize that translation list for future translations.
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...