Forum > Translations
The meaning of %s
nikel:
Hello, I found a lot of mistakes in Turkish translation and I'm trying to fix them. There are some wildcards like %s in the translation file. I want to ask what does the second %s mean here:
--- Quote ---Unable to clean up "%s".%sPlease check permissions.
--- End quote ---
EDIT: And is there a tool for previewing language phrases?
balazsszekely:
It means that %s will be replaced at run time by some string:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var value1: string; value2: string;begin value1 := 'test'; value2 := 'You have insufficient privileges.'; ShowMessage(Format('Unable to clean up "%s".%sPlease check permissions.', [value1, value2]));end;
The final message would look like this: "Unable to cleanup "test".You have insufficient privileges.Please check permissions."
As a conclusion you should leave %s as it is.
nikel:
Hmm thanks for the tip.
I want to advise some changes for translation files. I'm sure this is a neccessity for some other languages as well.
For example if the source string is:
--- Quote ---There were errors while moving the file %s to directory %s
--- End quote ---
If someone wants to translate this string to Turkish, he needs to swap %s' I mean this would be better:
--- Quote ---There were errors while moving the file %s1% to directory %s2%
--- End quote ---
Where can I suggest this feature?
balazsszekely:
--- Quote ---Where can I suggest this feature?
--- End quote ---
Lazarus mailing list. You can subscribe here: http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
wp:
In this case you should file a bug report because the format string is not correct, it needs to contain index parameters, like in
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- s := Format('There were errors while moving the file %0:s to directory %1:s', [AFileName, ADirectory]); The number between % and the colon refer to the index in the parameter list. This is a built-in feature of the Format() function (https://www.freepascal.org/docs-html/rtl/sysutils/format.html).
The Turkisch translation then would be (writing in English because I cannot speak Turkish):
--- Quote ---'There were errors while moving to directory %1:s the file %0:s'
--- End quote ---
Or, if you did not work with BugTracker (https://bugs.freepascal.org/view_all_bug_page.php?project_id=1) before, please post here where this line is, I can change it for you.
Navigation
[0] Message Index
[#] Next page