|
|||
|
.NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Wish list for software localization tool > Question on "automatic localization of XML attributes"
|
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius |
|
||||||||||||||||
| Question on "automatic localization of XML attributes" - Wish list for software localization tool - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support | |||||||||||||||||
| Author | Post | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||
|
jhersant Member
|
We are evaluating, and will most definitely purchase, Sisulizer for our company. We have various applications, written in Delphi 7-2009, which have to be localized to various languages. The application itself is easy to localize, thanks to Sisulizer, but I have an issue regarding localization of external (XML) files used in this application. What I am trying to do is creating a multilanguage XML file containing various texts in various languages. The input is something like: <?xml version="1.0" encoding="utf-8"?> <Translations> <Item symbolic_name="#FIRST_TEXT#" text="This is the first text"/> <Item symbolic_name="#SECOND_TEXT#" text="This is the second text"/> </Translations> and the output should be like (2 languages defined): <?xml version="1.0" encoding="utf-8"?> <Translations> <Item symbolic_name="#FIRST_TEXT#" text="This is the first text" text_fr="C'est le premier texte" text_da="Det er den første text"/> <Item symbolic_name="#SECOND_TEXT#" text="This is the second text" text_fr="C'est le deuxième texte" text_da="Det er den anden text"/> </Translations> The attributes are:
Can Sisulizer generate such a file? In other words, is Sisulizer able to automatically generate the attributes and automatically add/remove attributes when I add/remove languages? I have tried to select the "multilingual file" option in the XML source property sheet, but this does not have any effect (the output file is actually a copy of the original file ... I just don't understand this option for XML files). An alternative is to use the "Localized files" options in the XML source property sheet, which produces standalone localized files per locale, but that is not really what we want. Thanks for your assistance.
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Janusz Grzybek Super Moderator
|
Hello, XML is very flexible language and current version of Sisulizer can’t to support correctly multilingual output file feature for all possible cases, because users XML solutions can be very diverse and we can’t to fulfill wishes of all users, and for this reason our solution could be unsatisfactorily for some users. E.g for your example: <?xml version="1.0" encoding="utf-8"?> <Translations> <Item symbolic_name="#FIRST_TEXT#" text="This is the first text"/> <Item symbolic_name="#SECOND_TEXT#" text="This is the second text"/> </Translations> Sisulizer doesn’t create multilingual contents, but for below example: <?xml version="1.0" encoding="utf-8"?> <Translations> <Item symbolic_name="#FIRST_TEXT#">This is the first text</Item> <Item symbolic_name="#SECOND_TEXT#">This is the second text</Item> </Translations> Sisulizer will build following output file: <?xml version="1.0" encoding="utf-8"?> <Translations> <Item symbolic_name="#FIRST_TEXT#">This is the first text</Item> <Item symbolic_name="#SECOND_TEXT#">This is the second text</Item> <Item xml:lang="fr" symbolic_name="#FIRST_TEXT#">C'est le premier texte" text</Item> <Item xml:lang="de" symbolic_name="#FIRST_TEXT#">Det er den første text</Item> <Item xml:lang="fr" symbolic_name="#SECOND_TEXT#">C'est le deuxième texte</Item> <Item xml:lang="de" symbolic_name="#SECOND_TEXT#">Det er den anden text</Item> </Translations> BTW: As I mentioned above we can’t fulfill all wishes, however we always listen our customers, and we try to implement interested user requests, and I’ll ask our R&D about your issue. Best regards, Janusz
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Salmenius Administrator
|
There was a bug in Sisulizer that prevented adding localized attributes in multilingual output files. I fixed it in build 281. Now Sisulizer adds localized attributes. For example if we have the original English XML file: <?xml version="1.0" encoding="UTF-8"?> <sample value="One"> <data>Two</data> </sample> If we add Finnish and Japanese to Sisulizer project and let Sisulizer to create the multilingual output file it will create this. <?xml version="1.0" encoding="utf-8"?> <sample value="One" value_fi="Yksi" value_ja="一"> <data>Two</data> <data xml:lang="fi">Kaksi</data> <data xml:lang="ja">二</data> </sample> I have marked with green those items SL adds. The naming convention of localized attributes is <originalname>_<xml:lang> Build 281 will come out in a week. Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
jhersant Member
|
Hello guys, Thanks for your quick answers. Janusz: I was not aware that Sisulizer could localize XML tag values (not mentioned in the help file as far as I can see). Thanks for your example and for "enlighting" me on this. Jaako: This is definitely good news. I am looking forward to seeing build 281, which apparently should do exactly was I was hoping for. Well done gentlemen: Quick, precise and detailed answers...great support indeed! Best regards, Jérôme
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
jhersant Member
|
I have installed build 281 yesterday and it seems that attribute localization is still not working as you said. The source file is : <?xml version="1.0" encoding="utf-8"?> <Translations> <Translation symbol="_(at)_Text1" text="This is text 1"/> <Translation symbol="_(at)_Text2" text="This is text 2"/> <Translation symbol="_(at)_Text3" text="This is text 3"/> <Translation symbol="_(at)_Text4" text="This is text 4"/> </Translations> I have selected "Multilingual file" in the output file radio group and Sisulizer outputs: <?xml version="1.0" encoding="utf-8"?> <Translations> <Translation symbol="_(at)_Text1" text="This is text 1"/> <Translation symbol="_(at)_Text2" text="This is text 2"/> <Translation symbol="_(at)_Text3" text="This is text 3"/> <Translation symbol="_(at)_Text4" text="This is text 4"/> </Translations> Which is basically a copy of the source file. I would have expected something like: <?xml version="1.0" encoding="utf-8"?> <Translations> <Translation symbol="_(at)_Text1" text="This is text 1" text_DE="Bla bla DE 1" text_FR="Bla bla FR 1"/> <Translation symbol="_(at)_Text2" text="This is text 2" text_DE="Bla bla DE 2" text_FR="Bla bla FR 2"/> <Translation symbol="_(at)_Text3" text="This is text 3" text_DE="Bla bla DE 3" text_FR="Bla bla FR 3"/> <Translation symbol="_(at)_Text4" text="This is text 4" text_DE="Bla bla DE 4" text_FR="Bla bla FR 4"/> </Translations> By the way, the version history did not mention that it was fixed. Did you miss/forget it? Best regards, Jérôme
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Janusz Grzybek Super Moderator
|
Hello, Bug was fixed, but Sisulizer creates multilingual contents of XML output files as localization attribute of tag, and Sisulizer expect enabling this tag item (Source properties > Tags tab) to localization, but it need localizable contents of tag, while in your case localizable are only tag attributes, and for this reason you can enable only these attributes, but not whole tag. So for e.g. <Translations> <Translation symbol="_(at)_Text1" text="This is text 1"/> </Translations> Sisulizer will create following output content: <Translations> <Translation symbol="_(at)_Text1" text=" This is text 1"/> </Translations> Because “Translation” tag is unavailable in Tags tab: Attachment: screen.png (Downloaded 33 times)
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Janusz Grzybek Super Moderator
|
If your tag will be changed to e.g.: <Translations> <Translation symbol="_(at)_Text1" text="This is text 1">something</Translation> </Translations> Sisulizer can create multilingual content, and you can to get following output contents (sample Sisulizer project have polish and Finnish translations): <Translations> <Translation symbol="_(at)_Text1" text="This is text 1">something</Translation> <Translation xml:lang="pl" symbol="_(at)_Text1" text="To jest tekst">something</Translation> <Translation xml:lang="fi" symbol="_(at)_Text1" text="Text in Finnish">something</Translation> </Translations> Because now you can enable parent tag item (not only tag attributes) to localization: Attachment: screen1.png (Downloaded 33 times)
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Janusz Grzybek Super Moderator
|
However I’ll ask our R&D about any solution for your issue. Best regards, Janusz
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Markus.Kreisel Administrator
|
Hi Jérôme, >> I would have expected something like: <?xml version="1.0" encoding="utf-8"?> <Translations> <Translation symbol="_(at)_Text1" text="This is text 1" text_DE="Bla bla DE 1" text_FR="Bla bla FR 1"/> <Translation symbol="_(at)_Text2" text="This is text 2" text_DE="Bla bla DE 2" text_FR="Bla bla FR 2"/> <Translation symbol="_(at)_Text3" text="This is text 3" text_DE="Bla bla DE 3" text_FR="Bla bla FR 3"/> <Translation symbol="_(at)_Text4" text="This is text 4" text_DE="Bla bla DE 4" text_FR="Bla bla FR 4"/> </Translations> << This structure looks a little bit odd to me. If you think of database normalization (http://en.wikipedia.org/wiki/Database_normalization#Normal_forms) this would hurt the first normal form. XML is not a database but reasons why these rules are a good idea could be adapted to XML. From that perspective is the solution Janusz defined the better structure: <?xml version="1.0" encoding="utf-8"?> <Translations> <Item symbolic_name="#FIRST_TEXT#">This is the first text</Item> <Item symbolic_name="#SECOND_TEXT#">This is the second text</Item> <Item xml:lang="fr" symbolic_name="#FIRST_TEXT#">C'est le premier texte" text</Item> <Item xml:lang="de" symbolic_name="#FIRST_TEXT#">Det er den første text</Item> <Item xml:lang="fr" symbolic_name="#SECOND_TEXT#">C'est le deuxième texte</Item> <Item xml:lang="de" symbolic_name="#SECOND_TEXT#">Det er den anden text</Item> </Translations> Just my 2 cents :-) Markus
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
jhersant Member
|
Thanks for your contributions. I am not entirely sure I understand the conclusion of this and would appreciate precise answers to the following items:
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Markus.Kreisel Administrator
|
Hi Jérôme, My issue is not with localizing attributes in general. It is about that there should not be attributes for the same reason in one row in the target. It should be like Janusz described with multiple rows. >>having all translation items in a single where localizations would be stored has attributes ... more compact and readable IMHO This approach has many downsides. - The lines will become very, very long for many languages - Lines will become even longer if the original contains a long string. Then it is very hard to read - It is not a good style if you look at normalization - It will need a special handling if you try to import - The name of the attribute contains the language code. - You can have user defined languages like xx and sub languages like de-DE. It will be very hard to find out what is the name and what is the language code. Janusz structure is simple the much better structured XML. I think that our R&D will prefer this. Best Markus
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Janusz Grzybek Super Moderator
|
Hello, With current build of Sisulizer you can localize attributes of (parent) tags without localizable values, but not for multilingual output file option, because localized items are also saved to output files as attributes of parent tag, so you need enable localization of parent tag. You can’t enable it if this tag hasn’t localizable content. You can translate attributes of tags without localizable values if you will select in source properties “Localized files” instead “Multilingual file”, because in this case Sisulizer simple localize existing attributes and doesn’t create new localization attributes. Best regards, Janusz
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Janusz Grzybek Super Moderator
|
because localized items are also saved to output files as attributes of parent tag, so you need enable localization of parent tag. XML is very flexible language, but has also hierarchical structure and we try to respect it for XML localization process too. Janusz
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
jhersant Member
|
Hello again, You came with interesting arguments Markus and, even though I have a tendency to prefer attributes over tag values, you have some really good points here. I think I will go with Janusz's idea where the text to be localized is defined as a tag value. The only disadvantage of this is the size of the output file, and a (much) larger number of nodes, but technically I don't see any problem with that. Thanks for you help guys!
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Markus.Kreisel Administrator
|
Hi Jérôme, You are right. The overhead of XML is huge. But today we deal with TB hard drives and high speed Internet :-) I'm not involved in Janusz communication with the R&D. I hope he can help you to use his structure. Markus
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| Current time is 02:07 am | |
| .NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Wish list for software localization tool > Question on "automatic localization of XML attributes" | |
Sisulizer software localization tool - Three simple steps to localize