Commit Graph

50 Commits

Author SHA1 Message Date
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Thierry Crozat
32d4173fda COMMON: Remove unused and useless getCurrentCharset in TransMan
Now all translations use unicode.
2021-10-02 23:50:21 +01:00
Thierry Crozat
ebd8915009 GUI: Simplify builtin language check 2021-10-02 23:50:21 +01:00
Eugene Sandulenko
5e7fe2dc57
JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
Vladimir Serbinenko
0d39e96f55 COMMON: Make TranslationManager reusable.
This makes it possible to reuse TranslationManager with different
files.
2020-12-17 09:49:18 +01:00
Bartosz Gentkowski
fe9c51892c DOXYGEN: doxygen review on remaining common headers
- textconsole.h
- timer.h
- translation.h
- ustr.h
- util.h
2020-11-22 16:57:25 +00:00
Zvika Haramaty
606eeae46f COMMON: move convertBiDiString out of TranslationManager 2020-11-04 22:27:24 +00:00
Thierry Crozat
186e6142a0 COMMON: Remove unused functions in TranslationManager
There were leftovers from the transition to U32String.
2020-10-30 22:54:09 +00:00
Bartosz Gentkowski
ec24687ce4 DOXYGEN: Add doxygen groups to header files in the common folder
Adding @defgroup and @ingroup doxygen tags into all headers
in the common folder that contain doxygen blocks.

This improves the structure, readability, and findability
of information in the resulting output.

This commit targets purely structure and does not deal with
the content of the currently existing doxygen documentation.
2020-10-04 18:25:50 +02:00
Thierry Crozat
927127abd5 I18N: Support having unicode characters in language names 2020-09-02 12:08:49 +02:00
aryanrawlani28
87df975686 GUI: U32: Wrap string in U32 if not using translations. 2020-08-30 14:43:41 +02:00
aryanrawlani28
185fb72783 GUI: U32: Improve U32 code
- Revert accidentally put translations in mt32.cpp
- Use U32::format in some places earlier missed
- Add %u and %i for u32::format
- Add support for GUIErrorMsgFormat to use u32::format internally
- Use the above whereever needed
- Improve linux tts by removing redundant code
- Some places I had changed nullptr -> "". Revert this
2020-08-30 14:43:41 +02:00
aryanrawlani28
3d97be2559 GUI: U32: Remove redundant code
Because po files now (should) use UTF-8, a bunch of code in ScummVM is redundant. This commit addresses that.

- Remove charsetMapping and related variables.
- Remove the code that used these functions.
- Remove cp_parser.cpp. This is removed because the use of codepages is no longer needed.
- Remove iso-8859-x codepages (see above message)
- Always set mapping as 0 in ThemeEngine::loadScalableFont
- Check if ascii or not by getting charset in about dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28
085f375c98 GUI: U32: Store messages as U32Strings and remove codepages reading from .dat
- The previous commit removes all codepage additions to the create_translations tool.
- Following that, this commit removes all the reading from .dat file related to codepages
2020-08-30 14:43:41 +02:00
aryanrawlani28
f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00
aryanrawlani28
2745d51fe7 GUI: U32: make convertBidiString take in and return u32strings 2020-08-30 14:43:41 +02:00
Zvika Haramaty
1f9d421558 COMMON: moved convertBiDiString(..lang) to unicode-bidi.h
Continuing the work at https://github.com/scummvm/scummvm/pull/2236,
which moved `convertBiDiString(..page)` to unicode-bidi.h,
now moving to there also the `(..lang)` flavour.

Thus, translation.h has only the SVM-GUI related function, and the
two util functions page+code are in unicode-bidi.
2020-05-19 12:32:58 +02:00
BLooperZ
5b2bc4a9d3 COMMON: move bidi conversion to str-bidi.h 2020-05-12 14:36:09 +02:00
BLooperZ
c30b22c628 COMMON: add bidi support for U32String 2020-05-12 14:36:09 +02:00
Zvika Haramaty
1b8f471c69 GUI: Added (partial) BiDI support
Added GNU FriBidi, thus allowing Hebrew (or other future RTL languages)
to be displayed correctly.
It's been implemented for all ScummVM GUI (as far as I have noticed),
and can be further used by the engines as needed.

This work is only partial, because for complete BiDI support we'll need
to mirror the widgets, and support input text areas (which currently
don't even support Hebrew text input at all).

Some changes are required in order to use this:
- Visual Studio:
  -- add FriBidi lib from https://github.com/ShiftMediaProject/fribidi
     (and place the files in the other libs location)
  -- add fribidi.dll to the current directory
  -- add fribidi.lib to VS library list
     (in GUI it's: Project -> scummvm Properties -> Linker ->
                   input -> Additional Dependencies)
  -- Add USE_FRIBIDI define
     either to:
         dists/msvc/ScummVM_Global.props   <PreprocessorDefinitions>
     or in GUI:
         Project -> scummvm Properties ->
         C/C++ -> Preprocessor -> Preprocessor Definitions
- GCC:
  -- install FriBidi
     e.g.,
        Ubuntu: `apt-get install libfribidi-dev`
        CentOS: `yum install fribidi-devel`
  -- rerun `configure`
2020-04-30 10:32:18 +02:00
Bastien Bouclet
955e18c648 COMMON: Use nullptr instead of NULL or 0 where appropriate 2018-05-10 08:35:46 +02:00
Johannes Schickel
854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Johannes Schickel
f63df3bf7b GRAPHICS/GUI: Implement charset mapping for TTF fonts.
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.
2012-01-29 16:26:20 +01:00
Johannes Schickel
3ddea4952d COMMON: Some minor formatting fixes in translation code.
Done by running astyle over the files.
2011-11-13 01:43:41 +01:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Jordi Vilalta Prat
a17c07bcaa I18N: Improve the fallback language auto-detection.
- 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-12-01 20:00:40 +00:00
Jordi Vilalta Prat
8393bc5b5f I18N: Don't build TranslationManager when translation is disabled.
svn-id: r54684
2010-11-30 18:50:19 +00:00
Max Horn
785590e504 COMMON: Push include file.h and fs.h from translation.h to translation.cpp
svn-id: r54357
2010-11-19 01:03:05 +00:00
Max Horn
cc61445599 COMMON: Cleanup translation manager code; add FIXME
svn-id: r54206
2010-11-11 18:22:35 +00:00
Jordi Vilalta Prat
8388e0dfea JANITORAL: Clean trailing whitespaces.
svn-id: r53160
2010-10-12 02:18:11 +00:00
Thierry Crozat
1177692701 GUI: Fix bug #3075649 (Fonts not found with built-in theme)
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-10-01 21:41:40 +00:00
Thierry Crozat
bf9404485e I18N: Add a macro to define a context for a translatable string.
Currently static strings are marked with the _s() macro so that xgettext knows
the string needs to be translated. But there was no way to tell xgettext that
the string could get translated in different contexts. This is the role of this new
macro.

svn-id: r52460
2010-08-30 22:20:16 +00:00
Thierry Crozat
a2a3073562 I18N: Look for translations data file in Themes path
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-28 15:51:23 +00:00
Thierry Crozat
bc821136fd i18n: Add support for context in translations.
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-23 19:45:14 +00:00
Johannes Schickel
7fd7689370 i18n: Formatting fixes.
svn-id: r52260
2010-08-21 13:38:08 +00:00
Johannes Schickel
a53d4dde66 i18n: Style fixes.
svn-id: r52257
2010-08-21 13:21:09 +00:00
Thierry Crozat
d00b8a5753 i18n: Sort the list of available languages alphabetically
svn-id: r52239
2010-08-20 20:42:13 +00:00
Eugene Sandulenko
040dfff8ce i18n: Move translations to standalone file. Patch #3044975
svn-id: r52208
2010-08-19 11:46:55 +00:00
Thierry Crozat
1c6b339bbc i18n: use user friendly language names in GUI
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-31 15:46:43 +00:00
Eugene Sandulenko
0e7ccb896d i18n: Add support for locale-dependent fonts
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-28 15:17:10 +00:00
Johannes Schickel
58fcda82f3 Remove support for translation of console messages.
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-26 18:07:41 +00:00
Johannes Schickel
49463c2bf9 Use USE_TRANSLATION, USE_DETECTLANG and USE_TERMCONV instead of (ENABLE_)TRANSLATION, DETECTLANG and TERMCONV.
svn-id: r49885
2010-06-15 19:20:58 +00:00
Johannes Schickel
f3288b0f26 Fix a typo.
svn-id: r49875
2010-06-15 17:47:04 +00:00
Johannes Schickel
f607fc59db Extend (and along with it add) some doxygen comments.
svn-id: r49872
2010-06-15 17:34:07 +00:00
Johannes Schickel
0bff5c29fe Use a Common::String instead of a fixed size array for _syslang in TranslationManager.
svn-id: r49871
2010-06-15 17:33:45 +00:00
Willem Jan Palenstijn
7c7054dbd1 Remove unnecessary svn:executable properties
svn-id: r49870
2010-06-15 17:14:38 +00:00
Max Horn
365973542c Add TranslationManager::getTranslation variant taking/returning a Common::String (should fix WinCE build)
svn-id: r49861
2010-06-15 15:50:37 +00:00
Max Horn
44ce741f9c Code formatting
svn-id: r49859
2010-06-15 15:39:59 +00:00
Eugene Sandulenko
859212df25 Implement translation support for ScummVM GUI.
Based on patch #2903830: "Updated Translation Prototype" by alexbevi
which in turn is based on patch #1739965 by jvprat.

Currently it builds all translations right into ScummVM. Once the
feature will be accepted more widely, i.e. more translations will
pop up, it will be trivial to move translation strings to external
file.

Finished translation: Russian
Unfinished translation: Hungarian

Things which are nice to do:
 - Language code -> language mapping for more user friendness
 - Specifying fonts to be used with language
 - Updating of interface language without restart. It will require
   moving of much code to reflowLayout() methods for each dialog

The .po files must be in single byte encodings. I.e. no support
for Unicode.

svn-id: r49759
2010-06-15 10:44:51 +00:00