← Back to team overview

bashareteam team mailing list archive

[Bug 426017] Re: Do not use concatenated translated strings

 

Released in 0.5.0

** Changed in: bashare
       Status: Fix Committed => Fix Released

-- 
Do not use concatenated translated strings
https://bugs.launchpad.net/bugs/426017
You received this bug notification because you are a member of BaShare
Team, which is subscribed to BaShare.

Status in BaShare, an easy to use http server with a gui: Fix Released

Bug description:
Concatenating string is a very bad idea when translating software, because the word order can be different from one language to the other. Sentences that incorporate a variable should be translated as one single sentence with variables in it, not as 2 or more sentences that get concatenated after being translated.

Gambas documentation recommends using the Subst() instruction instead: from http://gambasdoc.org/help/howto/translate

>> Beware not to concatenate translated strings, because the order of words
>> changes with the language. Use the Subst() instruction instead.

So, instead of doing (example taken form FMain.class)

    TrayIcon1.Tooltip = ("Upload of ") & name_file & (" finished")

we should write 

    TrayIcon1.Tooltip = Subst(("Upload of &1 finished"), name_file)

We need to detect and replace all those concatenations in BaShare's code.

Note:
The Gambas doc at http://gambasdoc.org/help/lang/subst warns that Gambas 3 you should enclose the argument index between '{' and '}'. If this works in Gambas 2, we should use that to ease the day that BaShare migrates to Gambas 3...