Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

Translations 9 years 4 months ago #6462

  • Dinko
  • Dinko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 91
  • Thank you received: 5
Hello.

I have problem with translation of resource string in some unit.
Some string are translated, some are not translated. That is the mystery.

I have unit which contain all resource string I use in application.
Following code is used to translate unit:

procedure FavLoadFullResourceStrings;
var MyFileName: String;
MyTranslate: String;
MyTranslate1: String;
MyResult: Boolean;
begin
try
// this is hardcoded file name
MyFileName := 'languages' + SysUtils.PathDelim + 'fullresourcestrings-updated.po';
MyTranslate := rsLoginNetworkErrorNetworkIDFor;
if FileExists(MyFileName) then begin
MyResult := Translations.TranslateUnitResourceStrings('FullResourceStrings', MyFileName);
end;
MyTranslate1 := rsLoginNetworkErrorNetworkIDFor;
// FavSaveToFile('MyTranslate1.txt', MyTranslate1);
except
end;
end;

Now, this function translates some string in unit and some not. It is not an issue of fuzzy strings because I checked.
I suspect to TranslateUnitResourceStrings, but I'm not sure. I tried for 6 hours many combinations and without success.

String which is not translated
#: fullresourcestrings.rsloginnetworkerrornetworkidfor
msgctxt "fullresourcestrings:rsloginnetworkerrornetworkidfor"
msgid "Network \"ID\" for office [%s] and terminal [%s] is different then yours. Your network ID is [%s]. Call technical support for assistance!!!"
msgstr "Network \"ID\" for office [%s] and terminal [%s] is different then yours. Your network ID is [%s]. Call technical support for assistance|ID de rețea pentru agenția [%s] și terminalul [%s] este diferit de al vostru. ID-ul vostru este [%s]. Sunați la Call Center pentru ajutor"


After translation I expect string

Network \"ID\" for office [%s] and terminal [%s] is different then yours. Your network ID is [%s]. Call technical support for assistance|ID de rețea pentru agenția [%s] și terminalul [%s] este diferit de al vostru. ID-ul vostru este [%s]. Sunați la Call Center pentru ajutor"

but nothing happen
Maybe exists some limitation in translation function which I'm not aware of.

I use CT 5.10 32 on Win64.
Any idea is appreciated.



Regards, Dinko

Please Log in or Create an account to join the conversation.

Translations 9 years 4 months ago #6463

  • Dinko
  • Dinko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 91
  • Thank you received: 5
I found immediate after first post.

Number of %s strings in original text must be the same as number of %s in translated text.
I have exactly double %s in translated text. It is made on purpose by me, because I need it.
So I found the reason, now I have to found elegant workaround.

Regards, Dinko

Please Log in or Create an account to join the conversation.

  • Page:
  • 1