Jump to content

Translators needed! Very small project.


subtledoctor

Recommended Posts

Try this:

ACTION_IF NOT VARIABLE_IS_SET ~%EE_LANGUAGE%~ BEGIN
  COPY_EXISTING ~leat01.itm~ ~override~
    READ_STRREF 0x08 ac_string
  BUT_ONLY
  ACTION_FOR_EACH lang IN ~en_US~ ~pl_PL~ ~de_DE~ ~es_ES~ ~fr_FR~ ~cs_CZ~ ~ru_RU~ ~ko_KR~ BEGIN
    WITH_TRA ~scales_of_balance/language/%lang%/armor.tra~ BEGIN
      OUTER_SPRINT ac_lang @10001
    END      
    ACTION_IF NOT (~%ac_string%~ STRING_CONTAINS_REGEXP ~%ac_lang%~) BEGIN
      OUTER_SPRINT yaras_lang ~%lang%~
    END
  END
END

I changed the first line (added ~~ around EE_LANGUAGE) and the first WITH_TRA line.

Link to comment

WITH_TRA was added in WeiDU v240. Can you make sure you are using WeiDU v240? (weidu --version)

 

Edit: I added the block of code I offered above to a random tp2 file and tried running it with WeiDU v240 and it did not give me any parse errors.

Link to comment

Yeah - the final code is like this:

ACTION_IF VARIABLE_IS_SET %EE_LANGUAGE% BEGIN
   OUTER_SPRINT yaras_lang ~%EE_LANGUAGE%~
END
The first instance only checks whether the variable is defined, so you only need the bare variable (enclosed by %%). The second instance sets a different variable to the *string* represented by the variable, so you need another set of ~~ or "".

 

(Pro tip: %%, ~~, and "" are all interchangeable, and each can represent either 'this is a variable' or 'this is a string.' I know most people around here already know that, I'm just mentioning it in case any amateurs stumble upon this thread in the future.)

Link to comment

While it is technically correct that %/"/~ are interchangeable, I find it confusing to use %% to surround a string, because %% is commonly used to retrieve a variable's value, so my initial thought whenever I see %var% is that it is retrieving the value. I have to look again, notice it doesn't also have ~~ or "" around it and realize it's actually just a string.

 

For clarity, I try to be consistent about using ~ ~ or " " (if the string itself contains a ~) to surround strings, and only using % % when retrieving a variable's value.

Link to comment

That's my practice as well. %variable% for variables, ~string~ or "string" for strings. It was a long time before i realized they are arbitrarily interchangeable.

 

The fourth delimiter is ~~~~~string~~~~~ (five tildes on each side of the text). I've actually used all four together in a single line of Weidu... thankfully i have not encountered a situation where it was necessary to use more than four delimiters. :p

Link to comment

I prefer to always quote strings (using ~ or ") and never quote variable names.

 

VARIABLE_IS_SET %EE_LANGUAGE%

The reason this is confusing is because % is not retrieving a value here. The name of the variable is being passed to VARIABLE_IS_SET.

Link to comment

Thread-o Necro! I need another little bit of help. Can anyone tell me how the word "Duration" is translated into various languages in spell descriptions? (You know, that one line up near the top of the description where it says stuff like,

 

Resist Fear
 
Level: 2
Range: 30 ft.
Duration: 1 hour

 

I need to do a REPLACE_TEXTUALLY on all spell descriptions, using this string:

 

~^Duration:.+$~

 

I'm thinking to do it the same way as with the YARAS mod: make a tiny .tra file for each language the game supports, find the installed game language, and use WITH_TRA to run the REPLACE_TEXTUALLY and have it catch the right line of text and replace it with the new duration.

Link to comment

Cool, thanks.

 

I wish there was a way I could just look at different versions of dialog.tlk, without reinstalling the game. Am I missing something obvious? I can find an example strref from the English version of dialog.tlk in Near Infinity... but all of the other installed versions of dialog.tlk are sitting there in the /lang folders. Rather than asking people on the internet, it would be nice if I could find the same strref in those .tlk files and get the answer myself...

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...