aboutsummaryrefslogtreecommitdiff
path: root/common/translation.cpp
AgeCommit message (Collapse)Author
2018-05-10COMMON: Use nullptr instead of NULL or 0 where appropriateBastien Bouclet
2017-07-10Revert "COMMON: Change way the Singleton instances are instantiated"Eugene Sandulenko
This reverts commit eefa72afa1978a9dea10f5b1833fcc8f58a3468e. With this patch ConfigManager is broken.
2017-07-10COMMON: Change way the Singleton instances are instantiatedThierry Crozat
This fixes tons of warnings with clang from a recent xcode version on macOS (and possibly other systems) complaining that an instantiation of _singleton is required but no definition is available.
2014-02-18COMMON: Make GPL headers consistent in themselves.Johannes Schickel
2012-03-13JANITORIAL: Simply use *x instead of *x.get() on smart pointers.Christoph Mallon
2012-01-29GRAPHICS/GUI: Implement charset mapping for TTF fonts.Johannes Schickel
The charsets used by the translations now need to have a "$(name).cp" file, which contains an charset index => unicode mapping. Otherwise create_translations will fail.
2011-11-13COMMON: Some minor formatting fixes in translation code.Johannes Schickel
Done by running astyle over the files.
2011-11-02COMMON: Fix warningEugene Sandulenko
2011-08-21BADA: Remove BADA defined check. Was a temp fix for simulator buildChris Warren-Smith
2011-08-21BADA: Initial BADA port implementationChris Warren-Smith
2011-06-30ALL: Require DECLARE_SINGLETON to be used in the Common namepsaceOri Avtalion
Silences the clang warning: static data member specialization of '_singleton' must originally be declared in namespace 'Common'; accepted as a C++0x extension [-Wc++0x-extensions] Wrapping "namespace Common {}" around the macro assignment causes clang to complain about a spurious semicolon, and removing the semicolon at the end of the macro causes some editors to misbehave. Changing the requirement of using the macro in one namespace (the global) to another (Common) seems a small price to pay to silence a warning.
2011-06-24COMMON: Look for translations.dat in Theme path before using SearchManThierry Crozat
2011-06-22COMMON: Improve loading of translations data fileThierry Crozat
Now if the header of the file is not correct it continues to look for a valid file, while before if the first file found was obsolete or corrupted translation was disabled even if a valid file was present in the search path.
2011-06-14COMMON: Fix crash in TranslationManager when reading long stringsThierry Crozat
It was writing data beyond the end of a buffer. This change makes sure this does not happen. It only changes reading of the messages since the language codes, charset names and contexts are always much smaller than the buffer.
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2011-04-28JANITORIAL: Reduce header dependencies in shared codeOri Avtalion
Some backends may break as I only compiled SDL
2010-12-01I18N: Improve the fallback language auto-detection.Jordi Vilalta Prat
- Broaden the range of language tags that could be accepted as fallback in auto-detection. For example, for a system with locale 'pt_PT', all of these would be accepted as valid fallbacks: 'pt_PT_*', 'pt', 'pt_*' - Make language codes matching case-insensitive as specified in RFC 4647. - Add support language code blocks longer than 2 characters. svn-id: r54715
2010-11-30I18N: Don't build TranslationManager when translation is disabled.Jordi Vilalta Prat
svn-id: r54684
2010-11-28BACKEND: Switch OSystem::getSystemLanguage return type to Common::String.Johannes Schickel
This is done as discussed on -devel. svn-id: r54516
2010-11-25COMMON: Adapt translation manager to use the OSystem for language detection.Johannes Schickel
svn-id: r54480
2010-11-19COMMON: Push include file.h and fs.h from translation.h to translation.cppMax Horn
svn-id: r54357
2010-11-16COMMON: Simplify DECLARE_SINGLETON macroMax Horn
This makes it possible to write DECLARE_SINGLETON(foo); instead of DECLARE_SINGLETON(foo) without causing a warning about an extra semicolon. The extra semicolon helps some editors at parsing the C++ code. svn-id: r54258
2010-11-13COMMON: Fix TranslationManagerThierry Crozat
Revision 54206 broke translations support because it uncovered a bug in the TranslationManager when reading the translations.dat file. In that file all the stored string lengths include the terminating 0 but Common::String expect a length without the terminating 0. Therefore all String objects created from reading the translations.dat file had an incorrect size. This caused the font file names to be wrong after adding the charset. svn-id: r54235
2010-11-11COMMON: Fix compilation when translation support is disabled (regression ↵Johannes Schickel
from r54207). svn-id: r54209
2010-11-11COMMON: Cleanup translation manager code; add FIXMEMax Horn
svn-id: r54206
2010-10-12JANITORAL: Clean trailing whitespaces.Jordi Vilalta Prat
svn-id: r53160
2010-10-01GUI: Fix bug #3075649 (Fonts not found with built-in theme)Thierry Crozat
When switching to a theme that do not have the fonts needed to properly display the current language, it now revert to the previously used theme and display an error message telling the user to change the language first if he wants to use the theme he selected. svn-id: r52969
2010-08-28I18N: Look for translations data file in Themes pathThierry Crozat
If the translations.dat file is not found using the SearchMan, it now looks for that file into the themepath directory and sub-directories (if the path is defined). svn-id: r52428
2010-08-23i18n: Add support for context in translations.Thierry Crozat
This change means there can now be different translations for the same english string depending on the context. It is based on gettext msgctxt feature. There is a new macro _c(msg, ctxt) that should be used instead of _(msg) in the source code when we want to add a context to the message. For the moment I have added contexts to only one message ("None") so that I could test the changes. Context could be added also to get shorter translations when GUI is in 1x mode. I have also added back the fuzzy option to msmerge since it is useful when adding contexts to populate the translations for the new contexts. svn-id: r52308
2010-08-21i18n: Changed wording of messages about translations.dat file.Johannes Schickel
svn-id: r52261
2010-08-21i18n: Formatting fixes.Johannes Schickel
svn-id: r52260
2010-08-21i18n: Style fixes.Johannes Schickel
svn-id: r52257
2010-08-20i18n: Fix previous commit when translation support is disabledThierry Crozat
Previous commit of translation.cpp introduced a defined but not implemented operator when the translation support was disabled. This was probably fine since it was not used, but not very clean. svn-id: r52241
2010-08-20i18n: Sort the list of available languages alphabeticallyThierry Crozat
svn-id: r52239
2010-08-19i18n: Move translations to standalone file. Patch #3044975Eugene Sandulenko
svn-id: r52208
2010-08-12i18n: Fix link error when localization is disabledThierry Crozat
This fix a regression introduced in revision 50448 ("Add support for locale-dependant font'). When disabling localization a function was declared, called but not implemented. svn-id: r52048
2010-07-31i18n: use user friendly language names in GUIThierry Crozat
The GUI now uses the content of the Language field from the po file header if it is present and not empty for the language selection PopupWidget. If not present it uses the file name as before (e.g. ru_RU). Also update all the translation template and all the translation files. svn-id: r51542
2010-07-21Strip trailing whitespaces in our common code base.Johannes Schickel
svn-id: r51094
2010-06-28i18n: Add support for locale-dependent fontsEugene Sandulenko
Currently it ws not decided where to put fonts, but if you put BDF files into themepath, they will get picked up. The font name has to contain same codepage specification as in the .po file, i.e. fixed5x8-iso-8859-5.bdf for Cyrillic codepage. In case the font does not exist, default will be used. All built in fonts get proper names. TODO: Currently there is a bug with our font cacher. Font clR6x12-iso-8859-5 is empty after loading from FCC file. Reason is unknown. svn-id: r50448
2010-06-26Add some explanation why we can not just use setlocale on Win32.Johannes Schickel
svn-id: r50354
2010-06-26Use "C" on Win32 as syslang in case the locale could not be determined.Johannes Schickel
svn-id: r50353
2010-06-26Fix compilation with our default build system when USE_DETECTLANG is specified.Johannes Schickel
svn-id: r50349
2010-06-26Implement support for auto detection of the users preferred locale on Windows.Johannes Schickel
Note that this might break support for Windows versions older than Win2k, at least according to the MSVC docs GetLocaleInfo is only supported by Win2k+. I added a comment about that though. svn-id: r50348
2010-06-26Remove support for translation of console messages.Johannes Schickel
In recent discussions on -devel it turned out, that this feature is rather superfluous and instead we should rather implement a proper error reporting in our GUI. I also removed the dependency on iconv along with this. svn-id: r50335
2010-06-21Fixed some Cppcheck warnings. (There are plenty left, if anyone's wondering.)Torbjörn Andersson
svn-id: r50120
2010-06-18Properly provide stub implementations for all TranslationManager methods ↵Johannes Schickel
when USE_TRANSLATIONS is not defined. svn-id: r49997
2010-06-17Correction for Invalid reads in Translation iconv calls reported by Valgrind.David Turner
The string terminators were omitted from the iconv call and not restored. svn-id: r49916
2010-06-15Use USE_TRANSLATION, USE_DETECTLANG and USE_TERMCONV instead of ↵Johannes Schickel
(ENABLE_)TRANSLATION, DETECTLANG and TERMCONV. svn-id: r49885
2010-06-15Simplify code for the "ICONV_USES_CONST" case even more. (i.e. remove the ↵Johannes Schickel
"msg" variable there). svn-id: r49880
2010-06-15Fix compilation when using ICONV_USES_CONST.Andre Heider
svn-id: r49878