diff --git a/po/bg.po b/po/bg.po index d6a843eaf6..8bff0f51a0 100644 --- a/po/bg.po +++ b/po/bg.po @@ -20793,3 +20793,6 @@ msgstr " #, fuzzy #~ msgid "Insets|n" #~ msgstr "蚂龛(I)|I" + +msgid "[[Replace with the code of your language]]" +msgstr "bg" diff --git a/po/ca.po b/po/ca.po index 09b758ba84..d4e7244b57 100644 --- a/po/ca.po +++ b/po/ca.po @@ -15903,3 +15903,6 @@ msgstr "Usuari desconegut" #~ msgid "theorem" #~ msgstr "teorema" + +msgid "[[Replace with the code of your language]]" +msgstr "ca" diff --git a/po/cs.po b/po/cs.po index 042a168792..8546c804cb 100644 --- a/po/cs.po +++ b/po/cs.po @@ -16105,3 +16105,6 @@ msgstr "Nezn #, fuzzy #~ msgid "Insets|n" #~ msgstr "Vlo緄t|V" + +msgid "[[Replace with the code of your language]]" +msgstr "cs" diff --git a/po/da.po b/po/da.po index e2ee7c6f3e..d9f690df0c 100644 --- a/po/da.po +++ b/po/da.po @@ -17118,3 +17118,6 @@ msgstr "Ukendt indstik" #, fuzzy #~ msgid "Insets|n" #~ msgstr "Inds鎡|I" + +msgid "[[Replace with the code of your language]]" +msgstr "da" diff --git a/po/de.po b/po/de.po index 7719704654..9c7ca6aa1a 100644 --- a/po/de.po +++ b/po/de.po @@ -15938,3 +15938,6 @@ msgstr "Unbekannter Benutzer" #~ msgid "Acknowledgement \\arabic{theorem}" #~ msgstr "Danksagung \\arabic{theorem}" + +msgid "[[Replace with the code of your language]]" +msgstr "de" diff --git a/po/es.po b/po/es.po index cbffaa474e..e266818e33 100644 --- a/po/es.po +++ b/po/es.po @@ -16625,3 +16625,6 @@ msgstr "Usuario desconocido" #, fuzzy #~ msgid "Insets|n" #~ msgstr "Insertar|I" + +msgid "[[Replace with the code of your language]]" +msgstr "es" diff --git a/po/eu.po b/po/eu.po index f691af4008..593f0e9a5e 100644 --- a/po/eu.po +++ b/po/eu.po @@ -16602,3 +16602,6 @@ msgstr "Erabiltzaile ezezaguna" #, fuzzy #~ msgid "Insets|n" #~ msgstr "Txertatu|T" + +msgid "[[Replace with the code of your language]]" +msgstr "eu" diff --git a/po/fi.po b/po/fi.po index 1d04152f74..45a7a69bab 100644 --- a/po/fi.po +++ b/po/fi.po @@ -17355,3 +17355,6 @@ msgstr "Tuntematon sana:" #, fuzzy #~ msgid "Insets|n" #~ msgstr "Lis滗|L" + +msgid "[[Replace with the code of your language]]" +msgstr "fi" diff --git a/po/fr.po b/po/fr.po index c4fb0b0142..5e2256b81d 100644 --- a/po/fr.po +++ b/po/fr.po @@ -16839,3 +16839,6 @@ msgstr "Utilisateur inconnu" #, fuzzy #~ msgid "Insets|n" #~ msgstr "Ins閞er|I" + +msgid "[[Replace with the code of your language]]" +msgstr "fr" diff --git a/po/gl.po b/po/gl.po index 6e007d4320..5132d3d1fa 100644 --- a/po/gl.po +++ b/po/gl.po @@ -15805,3 +15805,6 @@ msgstr "Usu #~ msgid "Acknowledgement \\arabic{theorem}" #~ msgstr "Agradecimento \\arabic{theorem}" + +msgid "[[Replace with the code of your language]]" +msgstr "gl" diff --git a/po/he.po b/po/he.po index c25bee27df..dad8a41bc5 100644 --- a/po/he.po +++ b/po/he.po @@ -16106,3 +16106,6 @@ msgstr "%s: 砖讜专讛 %d: 诪砖转诪砖 诇讗 诪讜讻专 %s\n" #, fuzzy #~ msgid "Opened Theorem Inset" #~ msgstr "注专讻转 讛讻诇讬诐 讛谞讜住驻转 砖诇 Andrew" + +msgid "[[Replace with the code of your language]]" +msgstr "he" diff --git a/po/hu.po b/po/hu.po index 18f1f800bd..25066eda58 100644 --- a/po/hu.po +++ b/po/hu.po @@ -16139,3 +16139,6 @@ msgstr "Ismeretlen felhaszn #~ msgid "Insets|n" #~ msgstr "Bet閠ek|k" + +msgid "[[Replace with the code of your language]]" +msgstr "hu" diff --git a/po/it.po b/po/it.po index c1c7f9f453..efb37b7f52 100644 --- a/po/it.po +++ b/po/it.po @@ -16688,3 +16688,6 @@ msgstr "Utente sconosciuto" #, fuzzy #~ msgid "Insets|n" #~ msgstr "Inserisci|I" + +msgid "[[Replace with the code of your language]]" +msgstr "it" diff --git a/po/ja.po b/po/ja.po index 36a74484fa..0a2cdec0c5 100644 --- a/po/ja.po +++ b/po/ja.po @@ -15775,3 +15775,6 @@ msgstr "" #: src/support/userinfo.cpp:44 msgid "Unknown user" msgstr "鏈煡銇儲銉笺偠銉" + +msgid "[[Replace with the code of your language]]" +msgstr "ja" diff --git a/po/ko.po b/po/ko.po index aa6d5f34a5..ba3c3297df 100644 --- a/po/ko.po +++ b/po/ko.po @@ -15798,3 +15798,6 @@ msgstr " #, fuzzy #~ msgid "special char" #~ msgstr "漂荐 巩磊|S" + +msgid "[[Replace with the code of your language]]" +msgstr "ko" diff --git a/po/nb.po b/po/nb.po index 151737675c..101aa4af35 100644 --- a/po/nb.po +++ b/po/nb.po @@ -15716,3 +15716,6 @@ msgstr "Ukjent bruker" #~ msgid "Toc" #~ msgstr "Innhold" + +msgid "[[Replace with the code of your language]]" +msgstr "nb" diff --git a/po/nl.po b/po/nl.po index 248ecb7414..b4b98d0a97 100644 --- a/po/nl.po +++ b/po/nl.po @@ -17492,3 +17492,6 @@ msgstr "Onbekend:" #, fuzzy #~ msgid "Insets|n" #~ msgstr "Invoegen|I" + +msgid "[[Replace with the code of your language]]" +msgstr "nl" diff --git a/po/nn.po b/po/nn.po index a49a71671e..1bed8f2ddd 100644 --- a/po/nn.po +++ b/po/nn.po @@ -15863,3 +15863,6 @@ msgstr "ukjend brukar" #~ msgid "primitive" #~ msgstr "primetiv" + +msgid "[[Replace with the code of your language]]" +msgstr "nn" diff --git a/po/pl.po b/po/pl.po index e345807567..73bb644df2 100644 --- a/po/pl.po +++ b/po/pl.po @@ -16618,3 +16618,6 @@ msgstr "Nieznany u #, fuzzy #~ msgid "Insets|n" #~ msgstr "Wstaw|W" + +msgid "[[Replace with the code of your language]]" +msgstr "pl" diff --git a/po/pt.po b/po/pt.po index da34cce159..26060e5a0e 100644 --- a/po/pt.po +++ b/po/pt.po @@ -17851,3 +17851,6 @@ msgstr "A #, fuzzy #~ msgid "Insets|n" #~ msgstr "Inserir" + +msgid "[[Replace with the code of your language]]" +msgstr "pt" diff --git a/po/ro.po b/po/ro.po index 7870724b9f..435f872304 100644 --- a/po/ro.po +++ b/po/ro.po @@ -16774,3 +16774,6 @@ msgstr "Cuv #, fuzzy #~ msgid "Insets|n" #~ msgstr "Inserare|I" + +msgid "[[Replace with the code of your language]]" +msgstr "ro" diff --git a/po/ru.po b/po/ru.po index 47c07324b7..19467d7c39 100644 --- a/po/ru.po +++ b/po/ru.po @@ -17302,3 +17302,6 @@ msgstr " #, fuzzy #~ msgid "Insets|n" #~ msgstr "饔粤咨载|" + +msgid "[[Replace with the code of your language]]" +msgstr "ru" diff --git a/po/sk.po b/po/sk.po index bfb6a7a42c..c662283676 100644 --- a/po/sk.po +++ b/po/sk.po @@ -16964,3 +16964,6 @@ msgstr "Nezn #, fuzzy #~ msgid "Insets|n" #~ msgstr "Vlo緄粅I" + +msgid "[[Replace with the code of your language]]" +msgstr "sk" diff --git a/po/sl.po b/po/sl.po index 5d5ab91e6d..66e2f0385e 100644 --- a/po/sl.po +++ b/po/sl.po @@ -17330,3 +17330,6 @@ msgstr "Neznana beseda:" #, fuzzy #~ msgid "Insets|n" #~ msgstr "Vstavi|V" + +msgid "[[Replace with the code of your language]]" +msgstr "sl" diff --git a/po/sv.po b/po/sv.po index 4bb1abacca..e87b26c503 100644 --- a/po/sv.po +++ b/po/sv.po @@ -17788,3 +17788,6 @@ msgstr "Ok #, fuzzy #~ msgid "Insets|n" #~ msgstr "L鋑g in" + +msgid "[[Replace with the code of your language]]" +msgstr "sv" diff --git a/po/tr.po b/po/tr.po index ac7e3d4fca..6974ef2f08 100644 --- a/po/tr.po +++ b/po/tr.po @@ -16440,3 +16440,6 @@ msgstr "Bilinmeyen kullan #, fuzzy #~ msgid "Insets|n" #~ msgstr "Ekle|E" + +msgid "[[Replace with the code of your language]]" +msgstr "tr" diff --git a/po/wa.po b/po/wa.po index cb28fd55de..c8676086bb 100644 --- a/po/wa.po +++ b/po/wa.po @@ -17774,3 +17774,6 @@ msgstr "Bouye n #, fuzzy #~ msgid "Insets|n" #~ msgstr "Sititch" + +msgid "[[Replace with the code of your language]]" +msgstr "wa" diff --git a/po/zh_CN.po b/po/zh_CN.po index f8cca54afe..6af8dbb7f6 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -15803,3 +15803,6 @@ msgstr "鏈煡鐢ㄦ埛" #~ msgid "Adapt outp&ut" #~ msgstr "Adapt outp&ut" + +msgid "[[Replace with the code of your language]]" +msgstr "zh_CN" diff --git a/po/zh_TW.po b/po/zh_TW.po index 49bde4a88d..952e075ee0 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -17171,3 +17171,6 @@ msgstr "涓嶆槑鐨勪娇鐢ㄨ" #, fuzzy #~ msgid "Opened Theorem Inset" #~ msgstr "闁嬪暉鐨 Theorem 鍏ф彃" + +msgid "[[Replace with the code of your language]]" +msgstr "zh_TW" diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp index 0622e351c2..6e255d277e 100644 --- a/src/support/filetools.cpp +++ b/src/support/filetools.cpp @@ -302,44 +302,44 @@ FileName const libFileSearch(string const & dir, string const & name, FileName const i18nLibFileSearch(string const & dir, string const & name, string const & ext) { - // the following comments are from intl/dcigettext.c. We try - // to mimick this behaviour here. /* The highest priority value is the `LANGUAGE' environment variable. But we don't use the value if the currently - selected locale is the C locale. This is a GNU extension. */ - /* [Otherwise] We have to proceed with the POSIX methods of - looking to `LC_ALL', `LC_xxx', and `LANG'. */ + selected locale is the C locale. This is a GNU extension. - string lang = getEnv("LC_ALL"); - if (lang.empty()) { - lang = getEnv("LC_MESSAGES"); - if (lang.empty()) { - lang = getEnv("LANG"); - if (lang.empty()) - lang = "C"; - } - } + Otherwise, w use a trick to guess what gettext has done: + each po file is able to tell us its name. (JMarc) + */ + string lang = to_ascii(_("[[Replace with the code of your language]]")); string const language = getEnv("LANGUAGE"); - if (lang != "C" && lang != "POSIX" && !language.empty()) + if (!lang.empty() && !language.empty()) lang = language; string l; lang = split(lang, l, ':'); - while (!l.empty() && l != "C" && l != "POSIX") { - FileName const tmp = libFileSearch(addPath(dir, token(l, '_', 0)), - name, ext); + while (!l.empty()) { + FileName tmp; + // First try with the full name + tmp = libFileSearch(addPath(dir, l), name, ext); if (!tmp.empty()) return tmp; + + // Then the name without country code + string const shortl = token(l, '_', 0); + if (shortl != l) { + tmp = libFileSearch(addPath(dir, shortl), name, ext); + if (!tmp.empty()) + return tmp; + } + #if 1 - // to be removed later (JMarc) - FileName const tmpold = libFileSearch(dir, - token(l, '_', 0) + '_' + name, - ext); - if (!tmpold.empty()) { - lyxerr << "i18nLibFileSearch: File `" << tmpold + // For compatibility, to be removed later (JMarc) + tmp = libFileSearch(dir, token(l, '_', 0) + '_' + name, + ext); + if (!tmp.empty()) { + lyxerr << "i18nLibFileSearch: File `" << tmp << "' has been found by the old method" <