sillsdev / l10nsharp

A .NET localization library for Windows Forms applications.
3 stars 10 forks source link

Allow 3-letter ISO codes for localization languages #24

Closed StephenMcConnel closed 7 years ago

StephenMcConnel commented 7 years ago

This is on the xliff branch.


This change is Reviewable

JohnThomson commented 7 years ago

:lgtm: with one question


Reviewed 1 of 1 files at r1. Review status: all files reviewed at latest revision, 1 unresolved discussion.


src/L10NSharp/LocalizationManager.cs, line 405 at r1 (raw file):

          {
              var langId = Path.GetFileName(Path.GetDirectoryName(xliffFile));
              if (System.Text.RegularExpressions.Regex.IsMatch(langId, "[a-z]{2,3}") || langId == "zh-CN")

This relaxes things as to length, but tightens them in requiring lower-case alphabetic ascii characters. I think that's what ISO requires, but just wanted to check that you've thought carefully about any problems it might cause.


Comments from Reviewable

StephenMcConnel commented 7 years ago

Review status: all files reviewed at latest revision, 1 unresolved discussion.


src/L10NSharp/LocalizationManager.cs, line 405 at r1 (raw file):

Previously, JohnThomson (John Thomson) wrote…
This relaxes things as to length, but tightens them in requiring lower-case alphabetic ascii characters. I think that's what ISO requires, but just wanted to check that you've thought carefully about any problems it might cause.

Yes, ISO has 2-letter and 3-letter codes for languages, and the codes all consists of lowercase English/Latin letters without diacritics. We use the ISO code for the directory name. Before now, only 2-letter codes have been needed (these are available only for "major" languages), but there are a couple of languages with 3-letter codes in the pipeline for localization.


Comments from Reviewable