yairm210 / Unciv

Open-source Android/Desktop remake of Civ V

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Russian translation for number of civilizations too long

lolafur opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Game Version

4.11.3

Describe the bug

The game menu interface in Russian is displayed incorrectly and inconveniently. When you go to Unciv and click create a new game, the columns for choosing parameters: basic set of rules, difficulty, game speed, initial era, as well as the minimum and maximum number of civilizations, city-states, begin to shift. You have to swipe your finger to the left to scroll the menu to the side. In this case, you must select the Russian interface language.
If you switch the menu language to English, this problem also appears, but not so much. This applies to the first two columns when setting up the game.

Steps to Reproduce

  1. Go to 'Game menu'
  2. Click on 'Start new game'
  3. Scroll down to 'Game and map option'
  4. See the menu with a drop-down list and the sliders are shifted and you have to swipe to the left, see the full text

Screenshots

Screenshot_20240410_111124
Screenshot_20240410_111146

Link to save file

No response

Operating System

Android

Additional Information

No response

Sounds like this can be solved with a shorter translation for min/max number of civilizations - any suggestions?

Sounds like this can be solved with a shorter translation for min/max number of civilizations - any suggestions?

I am grateful to you for consulting with me :) I am more used to relying on developers, they better understand how to fix the flaw. I think that a shorter translation of some settings would be the best solution to this problem

Translators often do not really search for the context, so in a way they're not to blame.

Possibilities:

  • Comment these in templates, telling the xlator "prease keep as sholt as possibre" 1
  • Additionally: Give the label a separately templated tooltip. Now it's possible to have "Max # Civs" on the label and "Upper limit to\nthe number of civilizations that\nwill be randomly chosen" as tooltip... Yesiknowmobile...

Footnotes

  1. No disrespect meant. Got reminded of a chinese food chain having a bilingual menu - engrish on one side, rocar on the other. There were "spling lolls" on one side and - bingo - "loureaux plintemps" on the other. Bouffe excellente pour le bas prix.

Translators often do not really search for the context, so in a way they're not to blame.

Possibilities:

  • Comment these in templates, telling the xlator "prease keep as sholt as possibre" 1
  • Additionally: Give the label a separately templated tooltip. Now it's possible to have "Max # Civs" on the label and "Upper limit to\nthe number of civilizations that\nwill be randomly chosen" as tooltip... Yesiknowmobile...

Footnotes

  1. No disrespect meant. Got reminded of a chinese food chain having a bilingual menu - engrish on one side, rocar on the other. There were "spling lolls" on one side and - bingo - "loureaux plintemps" on the other. Bouffe excellente pour le bas prix.

If this shortcoming cannot be corrected in any way, then it’s not scary :)

Another option: Wrap.
image

Index: core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt b/core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt
--- a/core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt	(revision 2193e24364612b177ae61db889dacea5946f2939)
+++ b/core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt	(date 1713520566927)
@@ -30,6 +30,7 @@
 import com.unciv.ui.components.widgets.ExpanderTab
 import com.unciv.ui.components.widgets.TranslatedSelectBox
 import com.unciv.ui.components.widgets.UncivSlider
+import com.unciv.ui.components.widgets.WrappableLabel
 import com.unciv.ui.images.ImageGetter
 import com.unciv.ui.popups.Popup
 import com.unciv.ui.screens.basescreen.BaseScreen
@@ -273,6 +274,8 @@
                 update()  // To see the changed sliders
             }
 
+    private fun getColumnWidth() = previousScreen.stage.width * (if (isPortrait) 1f else 0.333f)
+
     private fun Table.addLinkedMinMaxSliders(
         minValue: Int, maxValue: Int,
         minText: String, maxText: String,
@@ -304,9 +307,15 @@
         }
         maxSlider.isDisabled = locked
 
-        add(minText.toLabel()).left().expandX()
+        val wrapWidth = getColumnWidth() * 0.6f
+        fun addWrappedLabel(text: String) {
+            val label = WrappableLabel(text, wrapWidth)
+            add(label).maxWidth(wrapWidth).left().expandX()
+            label.wrap = true
+        }
+        addWrappedLabel(minText)
         add(minSlider).padTop(10f).row()
-        add(maxText.toLabel()).left().expandX()
+        addWrappedLabel(maxText)
         add(maxSlider).padTop(10f).row()
     }

... the usual Label in Table and wrap will report prefWidth 0 which in turn ... That old kludge class just happened to work. Should try calling its optimizePrefWidth though, that's not automatic. Also maybe try a cleverer wrap width, with 60% column the sliders are still incomplete, haven't looked for what determines their min width...

Opinions?