...
- 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
- Project → Build in Selected Language will generate the updated/new resx files
- Save the Sisulizer project
- Open MarineLMS solution in Visual Studio
- Include newly created custom language specific 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)
- Update the newly added resx file's properties (2) to match the values of the counterpart's resx file (= default language resx file)
- Custom Tool: PublicResXFileCodeGenerator
- Custom Tool Namespace: [[namespace from corresponding default resx file]]
- Example: if you added AssessmentSummaryRx.en-US-Disney.resx, there is always a resx file AssessmentSummaryRx.resx.
- Include newly created custom language specific resx files (created by Sisulizer) to MarineLMS solution
- Commit all resx files and the Sisulizer project file /src/MarineLMS - Sisulizer Translation.slp and /src/MarineLMS - Sisulizer Translation.sds
Support Language Specific Date/Time Formats
In order to support different date and time formats for different locales all UI elements need to use the ILMSFormatter interface (class Formatters). The Formatters' Resx file contains date and time formats. Sisulizer context: MarineLMS.Web.Main\MarineLMS.Web.Main.csproj.Strings.MarineLMS.Web.Main.Util.FormattersRx.
Support Language Specific DatePicker
The Bootstrap date picker needs a separate js file for translations for different locales. For example bootstrap-datepicker.fr.min.js for French. The date picker doesn't support country specific language translations. That is, country specific languages like fr-CA and fr-FR would refer to fr only.
The following steps need to be done to add a new language to Visual Studio project Web.Main:
- 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
The date picker classes data-date-format and data-date-language must exist and have the correct values.
Code Block | ||
---|---|---|
| ||
div class="input-append date pull-left input-datepicker" data-date-format="@Model.DateFormatter.ShortDateAllNumbersFormat" data-date-language="@Model.DateFormatter.CurrentTwoLetterISOLanguageName" title="start date"> |
data-date-format: The date format for the DatePicker must contain numbers only - no month name like Jan or January is allowed.
data-date-language: The date language must be the 2 letter language name like en, fr,... The language name like 'fr' is deferred from the js script like 'bootstrap-datepicker.fr.min.js'.
Notes
Only Core web projects currently contain resx files and therefore only Core web projects are imported into Sisulizer.
...