Forum > Translations

I18N and maintaining PO files

<< < (4/4)

In my own dxgettext based windows only Delphi app, I have a combobox like Lazarus but with some additional options:

1. System default (whatever the default language detection yields, fall back to builtin if not detected)
2. none(no translation, easy to check what the key text is for a certain control)
3. a list of detected .mo files  (besides files on disk, it also checks a list of internal Windows resources), so the user can override.

The configuration setting is initialized on system default, and also reverts to that if the configuration contains a language for which the mo is no longer available. Changing the combobox is only active after restart. There are also some hacks to fall back from similar locales  (like map all german and french variants to the core french, since we don't really provide dialect translations).

One of the reasons is that the same app is sometimes used in multiple locations, with technical/lab staff preferring english(since they often receive betas and directly communicate with us), and the normal work floor in local language. But it is the same company so they all have the same localized windows.


--- Quote from: marcov on April 23, 2019, 10:55:58 am ---
--- Quote from: Thaddy on April 23, 2019, 10:22:41 am --- You should adhere to standards.

--- End quote ---

There is no standard. libgettext intercepts params on unix, but we don't use libgettext, so our parameters work differently. (and e.g. Lazarus allows setting language persistent without messing with environment variables or cmdline parameters)

--- End quote ---
Using the format alone counts as standard to me.... But it is largely a free world. I expect things to work, preferably in similar manners.

Yep, its no more that a couple of line to fix. Just needs (in LCLTranslator, FindLocalFileName()  )

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---if Application.HasOption('l', 'lang') then  lang := Application.GetOptionValue('l', 'lang')else begin     //     // do existing stuff that detects space separated syntax     //end;
Oh, and wp, the '=' syntax is the GNU recommended model, its just they accepts people do it with a space sometimes.

I'll put in a bug report with a patch.





[0] Message Index

[*] Previous page

Go to full version