mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Revert "Read list of translated languages from a file"
This reverts commit ed1515ef69
.
This commit is contained in:
parent
d7dd80e654
commit
a86de5d3c0
@ -180,10 +180,6 @@ m4_defun([AC_GNU_SOURCE],[])
|
||||
AM_GNU_GETTEXT([no-libtool])
|
||||
AM_GNU_GETTEXT_VERSION([0.16.1])
|
||||
AC_LANG_POP(C)
|
||||
AC_CONFIG_COMMANDS([lib/installed_translation], [
|
||||
rm -f lib/installed_translations
|
||||
echo $CATALOGS | sed 's/\.gmo//g' > lib/installed_translations
|
||||
])
|
||||
|
||||
# some standard header files
|
||||
AC_HEADER_MAJOR
|
||||
@ -375,7 +371,7 @@ AC_CONFIG_FILES([Makefile \
|
||||
development/cygwin/lyxrc.dist \
|
||||
development/lyx.spec \
|
||||
intl/Makefile \
|
||||
lib/lyx.desktop-temp:lib/lyx.desktop.in \
|
||||
lib/lyx.desktop-temp:lib/lyx.desktop.in
|
||||
lib/Makefile \
|
||||
lib/doc/Makefile \
|
||||
lib/lyx2lyx/lyx2lyx_version.py \
|
||||
|
@ -8,8 +8,6 @@ dist_pkgdata_DATA = CREDITS autocorrect chkconfig.ltx external_templates \
|
||||
encodings layouttranslations languages latexfonts symbols syntax.default \
|
||||
unicodesymbols
|
||||
|
||||
nodist_pkgdata_DATA = installed_translations
|
||||
|
||||
# We use DATA now instead of PYTHON because automake 1.11.2 complains.
|
||||
# Note that we "chmod 755" manually this file in install-data-hook.
|
||||
dist_pkgdata_DATA += configure.py
|
||||
|
@ -196,6 +196,10 @@ bool Language::read(Lexer & lex)
|
||||
encoding_ = encodings.fromLyXName("iso8859-1");
|
||||
LYXERR0("Unknown encoding " << encodingStr_);
|
||||
}
|
||||
// cache translation status. Calling getMessages() directly in
|
||||
// PrefLanguage::PrefLanguage() did only work if the gui language
|
||||
// was set to auto (otherwise all languages would be marked as available).
|
||||
translated_ = getMessages(code()).available();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -255,12 +259,8 @@ void Languages::read(FileName const & filename)
|
||||
}
|
||||
|
||||
// Read layout translations
|
||||
FileName path = libFileSearch(string(), "layouttranslations");
|
||||
FileName const path = libFileSearch(string(), "layouttranslations");
|
||||
readLayoutTranslations(path);
|
||||
|
||||
// Read installed translations
|
||||
path = libFileSearch(string(), "installed_translations");
|
||||
readInstalledTranslations(path);
|
||||
}
|
||||
|
||||
|
||||
@ -369,32 +369,6 @@ void Languages::readLayoutTranslations(support::FileName const & filename)
|
||||
}
|
||||
|
||||
|
||||
void Languages::readInstalledTranslations(support::FileName const & filename)
|
||||
{
|
||||
Lexer lex;
|
||||
lex.setFile(filename);
|
||||
lex.setContext("Languages::read");
|
||||
|
||||
// 1) read all installed gmo files names
|
||||
set<string> installed_translations;
|
||||
string lang_code;
|
||||
while (lex.isOK()) {
|
||||
lex >> lang_code;
|
||||
installed_translations.insert(lang_code);
|
||||
}
|
||||
|
||||
// 2) mark all corresponding languages as translated.
|
||||
LanguageList::iterator lit = languagelist.begin();
|
||||
LanguageList::iterator const lend = languagelist.end();
|
||||
for ( ; lit != lend ; ++lit) {
|
||||
if (installed_translations.count(lit->second.code())
|
||||
|| installed_translations.count(token(lit->second.code(), '_', 0)))
|
||||
lit->second.translated(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Language const * Languages::getLanguage(string const & language) const
|
||||
{
|
||||
if (language == "reset")
|
||||
|
@ -50,8 +50,6 @@ public:
|
||||
bool rightToLeft() const { return rightToLeft_; }
|
||||
/// Is an (at least partial) translation of this language available?
|
||||
bool translated() const { return translated_; }
|
||||
/// Is an (at least partial) translation of this language available?
|
||||
void translated(bool trans) { translated_ = trans; }
|
||||
/**
|
||||
* Translate a string from the layout files that appears in the output.
|
||||
* It takes the translations from lib/layouttranslations instead of
|
||||
@ -149,8 +147,6 @@ public:
|
||||
///
|
||||
void readLayoutTranslations(support::FileName const & filename);
|
||||
///
|
||||
void readInstalledTranslations(support::FileName const & filename);
|
||||
///
|
||||
Language const * getLanguage(std::string const & language) const;
|
||||
///
|
||||
size_type size() const { return languagelist.size(); }
|
||||
|
Loading…
Reference in New Issue
Block a user