In looking at your question, we should be safe. It is up to the translator to make adjustments for local syntax. As long as the base string contains the variable (i.e. %priceTotal%), the language's syntax can be used.
For example if the an American English phrase is: "The pineapple costs $2.00." and the string would be "costPineapple=The pineapple costs $%cost%." and the French string would be "costPineapple=L'ananas coƻte %cost% $." Thanks, *Caleb R. Williams* On Tue, Nov 29, 2016 at 4:30 PM, Dong Kim <dong...@andrew.cmu.edu> wrote: > Hi again, > > Thank you for the pointers! We realized that the panels do resize for > longer JButtons. However, for the messages, I'm not entirely sure if I > understand how the main FreeColMessages.properties get translated to other > property files. As an example, I've added the following new key value pairs > in FreeColMessages.properties: > > negotiationDialog.euBuyPrice=(EU Buy Price: %priceTotal%) > negotiationDialog.euSalePrice=(EU Sale Price: %priceTotal%) > negotiationDialog.goldTrade=%amount% gold > > And modified the following key value pairs: > > buy.text=The %nation% would like to sell their %goods% for %gold%\n (EU > buy price: %euprice%): > sell.text=The %nation% would like to buy your %goods% for %gold%\n (EU > sale price: %euprice%): > > I've also made changes to the buttons displayed on the panel (i.e. > NegotiationDialog) such as: > > button.setText(Messages.message(item.getLabel()) + " " + > Messages.message(StringTemplate > .template("negotiationDialog.euSalePrice") > .addAmount("%priceTotal%", salePriceTotal))); > > Does this conflict with any sentence structures in other languages? In the > game, everything is working as planned, but we haven't been testing in > other languages. > > On Mon, Nov 28, 2016 at 7:21 AM, <win...@genial.ms> wrote: > >> Hi, >> >> >> > Gesendet: Sonntag, 27. November 2016 um 22:07 Uhr >> > Von: "Michael T. Pope" <mp...@computer.org> >> > An: freecol-developers@lists.sourceforge.net >> > Betreff: Re: [Freecol-developers] More Questions About #43 >> > >> > On Sun, 27 Nov 2016 15:21:55 -0500 >> > Dong Kim <dong...@andrew.cmu.edu> wrote: >> > > I had a few more questions about ticket #43. In order to display EU >> selling >> > > price, we are currently creating a new string to append >> > > to Messages.message(item.getLabel()), and were wondering if we would >> need >> > > to manually add Messages.key = value in all FreeColMessages.properties >> > > files in /data/strings, or just simply keep the appended string. >> > >> > FreeColMessages.properties is the master messages file. The translators >> > use that to make the internationalized versions thereof in >> > .../data/strings. Do not edit those, only the master messages file. >> > >> >> You should be careful to avoid any string manipulation on possibly >> translated >> messages! For example, you might think its ok to just add them together >> and >> it might then look like it was correct in English, but some other >> languages >> can have other sentence structures and the thing you appended at the end >> might need to be in the middle of the sentence in some other language or >> it would be wrong. >> I think, messages allow for parameters the translators can move around in >> the translated sentence to avoid such problems. There are some helper >> methods >> for doing that and you should be able to find examples in code and the >> message file. >> >> > > We also realized that this may lead to overlapping text or other >> unexpected >> > > formatting in the UI if the text becomes too long, especially if the >> text >> > > is in a button. Where should we look in the code to manage this? >> > >> > Hopefully wintertime can comment here. I try to keep away from UI >> issues. >> > Generally though, where the text gets too long it can often be >> simplified >> > by using a (small) image, particularly for goods. >> > >> >> Swing widgets have automatic resizing, but for some elements it got >> disabled >> somehow in the code or constraints placed. FreeCol code is not consistent >> in regards to that, so it depends on the parts you want to change. >> Easiest is to just try it out (and it should also look well/be compatible >> with >> activated --gui-scale commant line option). >> >> > > Would it > be possible to dynamically change the size of panels and >> buttons according >> > > to the length of the text, or at least preserve text wrapping, if not >> done >> > > so already? >> > >> > I doubt it will be possible or desirable to change sizes of existing >> > elements. IIRC FreeCol generally tries to have the full text for >> buttons >> > ready at the point of creation thus allowing the Java libraries to size >> > them suitably. >> > >> >> Yes, I'd try to avoid changing sizes, but some small adaptations might >> turn out necessary. You better avoid putting too much text inside a >> button, >> as that would look strange. >> >> >> Greetings, >> >> wintertime >> >> ------------------------------------------------------------ >> ------------------ >> _______________________________________________ >> Freecol-developers mailing list >> Freecol-developers@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/freecol-developers >> > > > ------------------------------------------------------------ > ------------------ > > _______________________________________________ > Freecol-developers mailing list > Freecol-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/freecol-developers > >
------------------------------------------------------------------------------
_______________________________________________ Freecol-developers mailing list Freecol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freecol-developers