Commit Graph
50 Commits
Author SHA1 Message Date
widelec-BB 9fdebdce7a Fix loading tranlations on big endian platforms 2022-04-24 16:19:49 +02:00
Gleb Mazovetskiy 127615c33f Fix conversion of C-string literal to char* 2022-04-14 05:11:37 +02:00
Anders Jenbo 122ec0ac9d Fix crash when switching to English 2022-04-13 04:52:49 +02:00
Gleb Mazovetskiy 8138121e39 Fix endianness handling in language.cpp 2022-04-05 08:56:31 +01:00
Anders Jenbo d11eeaa9ec Log uninplemented plural expressions (#4017) 2022-02-01 08:30:08 +01:00
ephphatha 6a1091ce09 Rename Korean/Romanian translation files so they are used in fallback resolution 2022-01-04 23:20:53 +01:00
Andrew James e1d01aad7c Replace en_US code with en when searching for user preferred languages (#3859) 2021-12-30 04:12:17 +01:00
Gleb Mazovetskiy 02902e5188 language.cpp: Fix -Wwrite-strings 2021-12-16 19:32:27 +00:00
ephphatha a1652bd5d6 Interleave non-regional fallback locales after last regional variation 2021-12-14 07:07:38 +01:00
ephphatha c0ec4a845a Restore fallback for non-regional translation
Also adds an explicit check for en given this the base translation for the application and will never have a .mo/.gmo file.
2021-12-14 07:07:38 +01:00
Gleb Mazovetskiy a4bc8fea7d Fix warnings: -Wsign-compare, -Wnarrowing 2021-12-08 23:03:20 +00:00
obligaron 945ee04f62 Add OptionEntry Language 2021-11-28 19:08:10 +01:00
obligaron 0ac065dbaa Make LanguageInitialize() reentry capable 2021-11-28 19:08:10 +01:00
Gleb Mazovetskiy c57644970f Move UiFlags and UiPanels into their own files
The first breaks circular dependency between `DiabloUI` and `text_render`.
The latter one moves `UiPanels` to a more appropriate place.
2021-11-25 12:22:27 +01:00
Gleb MazovetskiyandAnders Jenbo 7e1fea6f76 clang-format all files in {Source,test}/
Also includes a few manual tweaks to comments and newlines for better results.

Co-authored-by: Anders Jenbo <[email protected]>
2021-11-24 23:44:12 +01:00
Gleb Mazovetskiy 4f64b87330 Fix talk/store text overlap for Chinese and Japanese
We ensure that selectable lines are placed at the same vertical
coordinates but space out unselectable text lines at the cost
of reduced heigh of empty space between the store items.

We also have to move the back button in scrollable lists to the
lower right.

This can definitely be improved further but at least it solves
the problem for now.

Refs #3162
2021-11-20 02:31:21 +00:00
Gleb Mazovetskiy fa90679416 game_assets.* -> assets.* 2021-11-17 11:49:57 +01:00
Gleb Mazovetskiy 3d308983a8 Migrate to libmpq
libmpq is a much simpler alternative to StormLib for reading MPQ archives.

We use our own fork of libmpq: https://github.com/diasurgical/libmpq

Impact:

* DevilutionX is now a lot more portable. Unlike StormLib, libmpq only
  needs platform-specific code for Windows.
* Locks around file access **removed** (instead we duplicate the file descriptor for streamed audio only).
* RAM usage is **300 KiB** lower than StormLib.
* Stripped release linux_x86_64 binary is **32 KiB** smaller.
* Amiga build now hangs instead of crashing.
2021-11-06 23:51:42 +00:00
Anders Jenbo f1efc205ff Add support for Romanian plural forms 2021-10-25 16:15:30 +02:00
Anders Jenbo 3b229a8275 Check for translation in the same place as they are loaded from 2021-10-24 16:03:26 +02:00
Gleb Mazovetskiy 3448eab2d3 Translations: Restore support for ".mo" files
Note that they now need to go into the "assets/" subdirectory of the
build directory.
2021-10-23 20:04:34 +02:00
Gleb Mazovetskiy 5e675dcd6a Handle translations like other assets
Load translations from the MPQ or the assets directory, same as we do
with other DevilutionX assets.
2021-10-23 20:04:34 +02:00
Anders Jenbo f77d0b3665 Close translation-file handler 2021-10-20 21:52:59 +02:00
Anders Jenbo d88a8f401f Fix parsing of translation file header 2021-10-17 05:50:24 +02:00
Anders Jenbo dd5ec18ca7 Remove dead code from translation parser 2021-10-17 05:50:24 +02:00
Anders Jenbo af046864de Properly handle plural forms for Czech and Polish 2021-10-16 17:53:43 +02:00
Anders Jenbo 704a04ae4d Add support for Unicode fonts 2021-09-24 03:03:58 +02:00
Anders Jenbo 671fdbd125 Implement contextural translation (pgettext)
Fixes #2369
Fixes #2790
2021-09-20 04:18:35 +02:00
Anders Jenbo 370e573209 Prefer test versions of translations 2021-08-08 21:58:05 +02:00
Ivan Epifanov cf5ab583d5 Open translations as read-only 2021-08-08 16:17:27 +02:00
Anders Jenbo d523fc1e81 Cleanups 2021-08-02 10:12:40 +02:00
Anders Jenbo 01f66d7f73 [android] Implement loading translations from assets 2021-08-01 12:35:24 +02:00
Anders Jenbo 5c2a559487 Get default langauge 2021-08-01 12:35:24 +02:00
Anders Jenbo 372b1dcba2 Clang-tidy: readability-identifier-naming.MemberCase: camelBack 2021-07-03 17:26:29 -07:00
Gleb Mazovetskiy 6a27b37d62 Windows: Handle Unicode paths in language.cpp 2021-05-10 12:35:37 +02:00
Anders Jenbo 3f891a4333 🌐 Correctly handle two more plural translation 2021-05-02 23:33:50 +02:00
Gleb Mazovetskiy f33f7ae7eb 💨 Do not zero-initalize arrays we write to
`std::make_unique<T[]>(size)` always zero-initalizes the array.

C++20 has `std::make_unique_for_overwrite` to avoid that, while
older C++ versions can use the approach applied here.
2021-05-02 05:52:11 +02:00
Anders Jenbo b177f77d21 🎨 Cleanup language.cpp 2021-05-02 05:22:42 +02:00
Anders Jenbo 18f3a0c5ea ✨ Support for plural forms in translations
The implementation isn't robust, dynamic or pretty, but works for now.
2021-05-01 19:27:55 +02:00
Anders Jenbo 34eecd6dac 🐛 Fix handeling of mo-file header 2021-04-30 21:20:58 +02:00
Gleb Mazovetskiy 979bedb8c2 🐞 Fix memory leaks in utils/language.{h,cpp}
This is a minimal refactoring to fix the memory leaks which have made
reading debug output impossible.
2021-04-30 14:16:13 +02:00
Gleb Mazovetskiy c025bf6050 🎨 Fix line endings in utils/language.{h,cpp} 2021-04-30 14:16:13 +02:00
Anders Jenbo e3526a5ff6 🌐 Convert all src to UTF8 2021-04-28 01:58:00 +02:00
JmgrandGleb Mazovetskiy d4f62870b8 Remove globals from paths.h
Fix for Vita

Update to use free functions

Use std::optional to allow setting empty paths

Change header inclusion order

Co-authored-by: Gleb Mazovetskiy <[email protected]>

Use std::optional to allow setting empty paths

Apply clang-format

Temporary commit
2021-04-25 22:26:37 +02:00
John Törnblom 102ee9ead1 convert utf8 language strings to latin1 2021-04-25 12:42:00 +02:00
John Törnblom 30db9e7dd0 trim strings from language metadata 2021-04-25 12:42:00 +02:00
John Törnblom 9c61baea9f parse translation metadata 2021-04-25 12:42:00 +02:00
John Törnblom 0be36898b9 ensure translations are null-terminated 2021-04-25 12:42:00 +02:00
Anders Jenbo 32117dc73b 🔧 Create translation template and update translations 2021-04-25 04:56:15 +02:00
John Törnblom 51e7a169a6 add initial language support using a simple MO parser 2021-04-25 03:40:45 +02:00