Comments (17)
To be sure, I revived bangla-translations branch, and yes, it is working:
from unciv.
This actually changed in fb47359
This means that Options -> Advanced -> Generate translation files did this
This could be a problem with the encoding we write the translation files in
In TranslationFileWriter line 236 it says "write the new files as UTF-8"
Does Bangla not work with UTF-8?
from unciv.
No, I see it should
And we read is using that same charset
Not sure what's going on there, maybe the stringbuilder...?
from unciv.
Anyway I would put a breakpoint in translationfilewriter and try to dig into where this change begins
from unciv.
Well damn
Java chars are always UTF-16 so I guess the back-and-forth encoding is what broke it
Then we should be able to solve this by just changing the read-and-write charset to UTF-16 and copy-pasting the old Bangla translations...?
from unciv.
Hilariously "copy file" doesn't copy the bangla - not sure what encoding the clipboard uses, and damn am I happy that I have never had to think about that before, what a mess
Okay so that didn't work, the read-to-write flow works but the entire translation mechanism fails
It's midnight here, I'm going to bed
from unciv.
NOPE reading UTF-8 files as UTF-16 did NOT work, that's almost certainly not the way
Not sure what is the problem
Debug TranslationFileWriter to find out, I guess
from unciv.
It's midnight here, I'm going to bed
It's 3:00AM here actually. But anyways, good night, see you later!
from unciv.
This actually changed in fb47359
Wait.................... This is not it................... I am pretty sure the reason is same as here: fb47359#r143772983
from unciv.
Basically, diacritics support rewrites strings with unassigned codepoints from UTF-16. Then it asks the OS to generate the bitmap fonts for the strings we rewrote so that we can display them.
Now, when you press the Options -> Advanced -> Generate translation files
button, original translations strings are already rewritten!! And this is causing the issue!!!
from unciv.
As, for how to fix it... Since, diacritics support is supposed to do this on the fly.. The originals have to stay somewhere locally...
That button is needed to modified such as it uses the originals, not the modified ones!!!
from unciv.
As for now, an easy fix would be copy paste my Bangla.properties from my pr and drop it to master. Unless we wait for this to be fixed. Again take my ping @SomeTroglodyte .
from unciv.
This will let us deploy 4.12.7 but maybe we really should not. As this is also problematic:
Unciv/fastlane/metadata/android/bn/full_description.txt
Lines 1 to 13 in fb47359
from unciv.
Basically, diacritics support rewrites strings with unassigned codepoints...
Exactly. Sorry I did not think of the effect on TFW. Basically, TFW would just need to load Bangla with that engine off I'd guess. Yea, "modified such as it uses the originals, not the modified ones".
ping
My Linux box still is not fully recovered - at least I proved the jumbled colours were due to the oibaf drivers. But checking Studio and the git state of Unciv I haven't had the courage yet, as it'll likely be frustrating with quite a few changes lost.
from unciv.
My Linux box still is not fully recovered - at least I proved the jumbled colours were due to the oibaf drivers. But checking Studio and the git state of Unciv I haven't had the courage yet, as it'll likely be frustrating with quite a few changes lost.
You don't need to check that history. For correct Bangla.properties
, copy paste it from #11755. The one at master has been corrupted.
from unciv.
Maybe:
Index: core/src/com/unciv/models/translations/Translations.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/src/com/unciv/models/translations/Translations.kt b/core/src/com/unciv/models/translations/Translations.kt
--- a/core/src/com/unciv/models/translations/Translations.kt (revision 9c864c34f0d7a65daed1395cce0137a57c108b73)
+++ b/core/src/com/unciv/models/translations/Translations.kt (date 1719999331512)
@@ -82,7 +82,7 @@
/** This reads all translations for a specific language, including _all_ installed mods.
* Vanilla translations go into `this` instance, mod translations into [modsWithTranslations].
*/
- private fun tryReadTranslationForLanguage(language: String) {
+ private fun tryReadTranslationForLanguage(language: String, noDiacritics: Boolean = false) {
val translationStart = System.currentTimeMillis()
val translationFileName = "jsons/translations/$language.properties"
@@ -107,21 +107,22 @@
modsWithTranslations[modFolder.name()] = translationsForMod
}
try {
- translationsForMod.createTranslations(language, TranslationFileReader.read(modTranslationFile))
+ translationsForMod.createTranslations(language, TranslationFileReader.read(modTranslationFile), noDiacritics)
} catch (ex: Exception) {
Log.error("Exception reading translations for ${modFolder.name()} $language", ex)
}
}
}
- createTranslations(language, languageTranslations)
+ createTranslations(language, languageTranslations, noDiacritics)
debug("Loading translation file for %s - %sms", language, System.currentTimeMillis() - translationStart)
}
@VisibleForTesting
- fun createTranslations(language: String, languageTranslations: HashMap<String, String>) {
- val diacriticSupport = DiacriticSupport(languageTranslations).takeIf { it.isEnabled() }
+ fun createTranslations(language: String, languageTranslations: HashMap<String, String>, noDiacritics: Boolean = false) {
+ val diacriticSupport = if (noDiacritics) null
+ else DiacriticSupport(languageTranslations).takeIf { it.isEnabled() }
for ((key, value) in languageTranslations) {
val hashKey = if (key.contains('[') && !key.contains('<'))
key.getPlaceholderText()
@@ -182,7 +183,7 @@
DiacriticSupport.reset()
for (language in getLanguagesWithTranslationFile()) {
- tryReadTranslationForLanguage(language)
+ tryReadTranslationForLanguage(language, noDiacritics = true)
}
DiacriticSupport.freeTranslationData()
.. turns off the fake alphabet mapping from readAllLanguagesTranslation
but not from tryReadTranslationForCurrentLanguage
- I think the former is TFW-only , the latter gameplay-only. And the TFW one doesn't need cleanup because it runs on a separate instance of Translations()
that is discarded after it's done. Likely has some unit-tests interaction though.
... but I still can't test or PR any code.
from unciv.
Hey Tou, this is worth a little chuckle:
https://search.f-droid.org/?q=unciv&lang=bn ...shows your fastlane short desc nicely...
Following the link, however, goes back to english. Which means they have a master selection of supported languages somewhere, and bn
is not on it. I suspected as much but didn't really check until now...
from unciv.
Related Issues (20)
- Nation/City State icon before city name in Wonders and Notifications Overview HOT 6
- Auto production on Work Boats
- Movement of Air units goes wrong.
- retracted
- AI: Balancing of accepting "unfavorable" trades (reason in this example related to gifted gold) HOT 11
- Unique stopped working, +1 HOT 2
- AutoEndturn bypassed Disabled Auto Build roads Option HOT 2
- Cannot enter Game in 4.12.12 in Android HOT 3
- Barbarian encampments appearing on map, even without Honor selected HOT 3
- Mod checker objecting to acceptable mapUnitFilter combinations
- Выдает ошибку HOT 1
- Feature request: option to disable animations
- Instant crash after update to 4.12.12 - SOLVED with 4.12.12-patch1 HOT 2
- Cannot buy buildings with other stats
- Feature request: Change Difficulty in Console
- Religion Buildings and Units Not Building HOT 1
- Force calculations getting massively screwed up in Wakanda mod
- Nation portraits are not working
- Crash, message copy/pasted
- crash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unciv.