mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
[the "translation" patch series] Part 3: improving the loading of localized files
* src/support/filetools.cpp (i18nLibFileSearch): use a trick to find out the name of the current translation. * po/*.po: add the entry necessary for the above trick. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19350 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f84a1c6e5c
commit
9b3aa538fc
3
po/bg.po
3
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"
|
||||
|
3
po/ca.po
3
po/ca.po
@ -15903,3 +15903,6 @@ msgstr "Usuari desconegut"
|
||||
|
||||
#~ msgid "theorem"
|
||||
#~ msgstr "teorema"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "ca"
|
||||
|
3
po/cs.po
3
po/cs.po
@ -16105,3 +16105,6 @@ msgstr "Nezn
|
||||
#, fuzzy
|
||||
#~ msgid "Insets|n"
|
||||
#~ msgstr "Vlo¾it|V"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "cs"
|
||||
|
3
po/da.po
3
po/da.po
@ -17118,3 +17118,6 @@ msgstr "Ukendt indstik"
|
||||
#, fuzzy
|
||||
#~ msgid "Insets|n"
|
||||
#~ msgstr "Indsæt|I"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "da"
|
||||
|
3
po/de.po
3
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"
|
||||
|
3
po/es.po
3
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"
|
||||
|
3
po/eu.po
3
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"
|
||||
|
3
po/fi.po
3
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"
|
||||
|
3
po/fr.po
3
po/fr.po
@ -16839,3 +16839,6 @@ msgstr "Utilisateur inconnu"
|
||||
#, fuzzy
|
||||
#~ msgid "Insets|n"
|
||||
#~ msgstr "Insérer|I"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "fr"
|
||||
|
3
po/gl.po
3
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"
|
||||
|
3
po/he.po
3
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"
|
||||
|
3
po/hu.po
3
po/hu.po
@ -16139,3 +16139,6 @@ msgstr "Ismeretlen felhaszn
|
||||
|
||||
#~ msgid "Insets|n"
|
||||
#~ msgstr "Betétek|k"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "hu"
|
||||
|
3
po/it.po
3
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"
|
||||
|
3
po/ja.po
3
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"
|
||||
|
3
po/ko.po
3
po/ko.po
@ -15798,3 +15798,6 @@ msgstr "
|
||||
#, fuzzy
|
||||
#~ msgid "special char"
|
||||
#~ msgstr "특수 문자|S"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "ko"
|
||||
|
3
po/nb.po
3
po/nb.po
@ -15716,3 +15716,6 @@ msgstr "Ukjent bruker"
|
||||
|
||||
#~ msgid "Toc"
|
||||
#~ msgstr "Innhold"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "nb"
|
||||
|
3
po/nl.po
3
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"
|
||||
|
3
po/nn.po
3
po/nn.po
@ -15863,3 +15863,6 @@ msgstr "ukjend brukar"
|
||||
|
||||
#~ msgid "primitive"
|
||||
#~ msgstr "primetiv"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "nn"
|
||||
|
3
po/pl.po
3
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"
|
||||
|
3
po/pt.po
3
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"
|
||||
|
3
po/ro.po
3
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"
|
||||
|
3
po/ru.po
3
po/ru.po
@ -17302,3 +17302,6 @@ msgstr "
|
||||
#, fuzzy
|
||||
#~ msgid "Insets|n"
|
||||
#~ msgstr "÷ÓÔÁ×ÉÔØ|÷"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "ru"
|
||||
|
3
po/sk.po
3
po/sk.po
@ -16964,3 +16964,6 @@ msgstr "Nezn
|
||||
#, fuzzy
|
||||
#~ msgid "Insets|n"
|
||||
#~ msgstr "Vlo¾i»|I"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "sk"
|
||||
|
3
po/sl.po
3
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"
|
||||
|
3
po/sv.po
3
po/sv.po
@ -17788,3 +17788,6 @@ msgstr "Ok
|
||||
#, fuzzy
|
||||
#~ msgid "Insets|n"
|
||||
#~ msgstr "Lägg in"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "sv"
|
||||
|
3
po/tr.po
3
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"
|
||||
|
3
po/wa.po
3
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"
|
||||
|
@ -15803,3 +15803,6 @@ msgstr "未知用户"
|
||||
|
||||
#~ msgid "Adapt outp&ut"
|
||||
#~ msgstr "Adapt outp&ut"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "zh_CN"
|
||||
|
@ -17171,3 +17171,6 @@ msgstr "不明的使用者"
|
||||
#, fuzzy
|
||||
#~ msgid "Opened Theorem Inset"
|
||||
#~ msgstr "開啟的 Theorem 內插"
|
||||
|
||||
msgid "[[Replace with the code of your language]]"
|
||||
msgstr "zh_TW"
|
||||
|
@ -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" <<endl;
|
||||
return tmpold;
|
||||
return tmp;
|
||||
}
|
||||
#endif
|
||||
lang = split(lang, l, ':');
|
||||
|
Loading…
Reference in New Issue
Block a user