Re: [Tiki-devel] How to create RTL translations?
Fabio Montefuscolo <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.devel |
|---|---|
| Message-ID | <CAF4KPBTUiT87RKwpPkxs3kmWjf6-CEDFZCac=Tpw75G1VwJ0zw@mail.gmail.com> |
On psysh Using the *%d* and *printf* ``` >>> *$format* = "منتقل %d تصاویر، %d غلطیاں واقع ہوئیں" => "منتقل %d تصاویر، %d غلطیاں واقع ہوئیں" >>> *printf*($*format*, 4, 5) منتقل 4 تصاویر، 5 غلطیاں واقع ہوئیں⏎ ``` Using the *%1* and *%2* and tr_replace ``` >>> include 'lib/init/tra.php' >>> $*format* = "منتقل کیا گیا %0 تصاویر، %1 نقائص واقع ہوئے" => "منتقل کیا گیا %0 تصاویر، %1 نقائص واقع ہوئے" >>> *tr_replace*($*format*, [4, 5]) => "منتقل کیا گیا 4 تصاویر، 5 نقائص واقع ہوئے" ``` Which one seems to be correct? On Tue, Jan 11, 2022 at 3:26 PM Fabio Montefuscolo < [email protected]> wrote: > Hello, > > (specially eastern folks) > > Recently, I got super confused when trying to help a girl from Pakistan to > add translations to Tiki. Urdu is a language written from right to left. > Just this aspect of the language is enough to short circuit my little brain. > > At least on Vim, I am struggling a lot to add placeholders into Urdu > messages. For example, in the middle of all that Urdu symbols, I need to > insert the ascii symbols %d. When I try that, it changes the flow to LTR > and split the phrase. > > Does that also happen to Hebrew (@bernard), for example? If yes, how do > you (@bernard❤) are doing to add placeholders like %d, %s, etc. > > *# Messy scenario 1:* > ## Steps to confusion using the string "*moved %d images, %d errors > occurred*": > *1.* Go to https://www.translator.eu/english/urdu/translation/ (google > translator is not working for me) > *2.* Paste "moved %d images, %d errors occurred" in the english field > *3.* The result should be something like "منتقل کردہ ٪ڈی تصاویر، ٪د نقائص > واقع ہوئے" > > Question: Where to replace %d ?? > > > *# Messy scenario 2:* > ## Steps to confusion using the string "*moved %d images, %d errors > occurred*": > *1.* Go to https://www.translator.eu/english/urdu/translation/ > *2.* Paste "moved ## images, ## errors occurred" in the english field > *3.* The result should be something like "منتقل ## تصاویر، ## غلطیاں واقع > ہوئیں" > *4.* Replace *##* by *%d* > *5.* Then you get "منتقل %d تصاویر، %d غلطیاں واقع ہوئیں" > > As you can see, the string is visually different. The chunks delimited by > %d had the order changed. I am not sure if the meaning changes when I do > that. > > *# Not so Messy scenario 3:* > ## Steps to confusion using the string "*moved %d images, %d errors > occurred*": > *1.* Go to https://www.translator.eu/english/urdu/translation/ > *2.* Paste "moved %0 images, %1 errors occurred" in the english field > *3.* The result should be something like "منتقل کیا گیا ٪0 تصاویر، ٪1 > نقائص واقع ہوئے" > *4.* Replace *٪* by *%.* > *5.* Then you get "منتقل کیا گیا %0 تصاویر، %1 نقائص واقع ہوئے" > > Here, the translations seems to be similar to the first case, but it is a > bit easier to work with. > > > Any hint is welcome! > Cheers > > > _______________________________________________ TikiWiki-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel