Giter Site home page Giter Site logo

Comments (5)

yairm210 avatar yairm210 commented on May 22, 2024

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

from unciv.

lolafur avatar lolafur commented on May 22, 2024

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

from unciv.

SomeTroglodyte avatar SomeTroglodyte commented on May 22, 2024

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.

from unciv.

lolafur avatar lolafur commented on May 22, 2024

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 :)

from unciv.

SomeTroglodyte avatar SomeTroglodyte commented on May 22, 2024

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?

from unciv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.