ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Localising CUI File

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Kyudos
987 Views, 3 Replies

Localising CUI File

It's not strictly ObjectARX, but perhaps you can help me...

 

Can strings (like the help string) in the CUI file be automatically localised? 

I mean instead of having (say) an English CUI file and a French CUI file, can I have a resource ID for the string and have that pulled from the DLL I create to hold my CUI images?

 

 

3 REPLIES 3
Message 2 of 4
tbrammer
in reply to: Kyudos

As far as I know this is not possible directly. We have been looking for something like that in the past year.
(I would be lucky if somebody would tell me I'm wrong and there is a way to do this)

We found two possible solutions. Both use a "language independend" CUIX file that contains message numbers instead of real messages.

1) Use CUI API functions to translate the language independend CUIX into different language versions and ship the appropriate language version.

2) Ship the language independend CUIX only and translate the ribbons at runtime.

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 3 of 4
Kyudos
in reply to: tbrammer

As there don't appear to be any official tools for this, I put together the attached Excel 2016 macro workbook to help me. I cribbed a lot of code from around the internet, so thanks to all people who silently contributed to this tool 🙂

 

It roughly does the following:

 

  • Extract - using the specified lists of node names (E4 onward) and attributes (F4 onward), unique strings are extracted from the input CUI or CUIX file (A1), sorted and placed in the input array (column A).
  • Find - this function finds and counts the number of instances of each string in the source file and puts the number in the sheet (column C). This is useful to check manually added strings are actually present.
  • Replace - each line of the input file(s) is read, all strings are replaced and the line is written to the output file using the specified encoding (C2).
  • Translate - using the specified language codes (in B1, out B2), each input string is translated using Google translate and the translated string place in the output array (column B). Obviously this is completely without context and won't be suitable for the vast majority of cases, but it provides some output strings you can test with.
  • Clear - delete all the data.

 

I hope this is useful to others. In the spirit of sharing, feel free to post and improvements here 🙂

Message 4 of 4
Kyudos
in reply to: Kyudos

I extended my original spreadsheet a little. In version 2 we have an extra function:

 

  • Import - imports any translated strings from the specified XLIFF file (A3) that match the input strings from the CUI(X) file (Col A). This allows you to use existing translations in XLIFF format  as a basis for your CUI(X) translation.

This moves everything else (w.r.t. v1) down a row, but hopefully that is obvious.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report