Join our Discord Channels!
Join our Steam Groups! Image TacBF Mod & TacBF Event Notifications.
@CBA_A3 & TacBF updated. | Get TacBF Launcher!
Recent updates applied: @CBA_A3 3.3.1-170504, @TacBF 3.24.10. (13 May 2017)
Image $ Please donate a little, to keep server. - Read more...

Example of Localization Procedure & Notes for DEVs

For the members of the language localisation group who are working on translating the existing system.

Moderator: mad rabbit

User avatar
mad rabbit
Community God
Community God
Posts: 2155
Joined: 24 Jan 2013, 12:39
In-game Name:
Location: Melbourne, Australia

Example of Localization Procedure & Notes for DEVs

Postby mad rabbit » 19 Jun 2014, 12:50

Example of Localization Procedure:
Step #1 - Extraction:
Step #2 - Translation:
Step #3 - Conversion:
Step #4 - Integration:
Step #5 - Debug:

Step #1 - Example of text string in function/dialog requiring translation = Extraction:
Image

Code: Select all

_textError = "<t size='1' color='#FF0000'>Please bind <t color='#c18f3a'>[Use Action 4]</t> under <t color='#c18f3a'>Configure -> Controls -> TacBF</t>. The same button is used for weapon resting. Raise your weapon (Left click) to drop the object for now.<br /><br /><br /><br /></t>";   


Step #2 - Example of text string broken-up into smaller pieces for translation = Translation:
Image

Step #3 - Example of translations converted into XML format for ArmA3 = Conversion:
Image

Step #4 - Example of localization back into function/dialog = Integration:
Image

User avatar
mad rabbit
Community God
Community God
Posts: 2155
Joined: 24 Jan 2013, 12:39
In-game Name:
Location: Melbourne, Australia

Re: Example of Localization Procedure & Notes for DEVs

Postby mad rabbit » 19 Jun 2014, 12:58

Notes for DEVs:

Stringletable.xml BIS WIKI: https://community.bistudio.com/wiki/Stringtable.xml

1) Substitute formatting in strings where possible
  • As shown in the above example, it is much easier if repeated 'formattedText' is given assigned variables to be used repeatedly PRIOR to extraction and subsequent delivery to translators.
  • It also makes bugs during integration less likely if the only checks that are required are for the string itself and not symbols, particularly due to the incompatibility of "<" and ">" symbols in the 'stringtable.xml' file.
  • spaces at the start/end of the original strings are not preserved when transferred to the 'stringtable.xml' file, therefore substitute in the code with +" "+

2) Avoid long blocks of text
  • More text = more translation required.
  • Long sentences are also more prone to getting mis-translated in comparison to singular words or phrases.

3) Avoid usage of strings as variables for boolean checks
  • Makes the initial extraction time-consuming to determine if the string in question is used for a boolean check within the function or is actual text to be displayed.

4) Stringtable.XML has not default language for empty entries

Code: Select all

<!--\ice\ice_squadManagement\initFunctions.sqf-->

   <Key ID="STR_ICE_sqdMgt_01">
      <Original>Squad Management</Original>
      <English>Squad Management</English>
      <Czech></Czech>
      <French>Gestion de l'escouade</French>
      <!--<German></German>-->
      <Italian>Gestione squadra</Italian>
      <Polish>Dowodzenie grupą</Polish>
      <Portuguese></Portuguese>
      <Russian>Управление отрядом</Russian>
      <Spanish>Gestión de Escuadra</Spanish>
   </Key>

  • In this example, the Squad Managment dialog would have not title in the Czech language but would default to English for the German language
  • It used to default to second column in older ArmA versions using stringtable.CSV as discussed here: https://community.bistudio.com/wiki/CSV_File_Format_-_Stringtables
  • Utilize "<!--" and "-->" comments as placeholders to substitute empty translations for a certain language to allow for default English language usage


Improved procedure for faster integration:
  1. XLSX
  2. Make STR names starting with <Key ID=" and ending with ">
  3. Add extra columns for language frame
  4. Added end column for </Key>
  5. Delete top row
  6. Export in tab delineated format. Not CSV as some string have commas and tabs easier for formatting.
  7. Change exported file extension to XML
  8. Open exported file in Notepad++
  9. Russian text will not export nor will some Polish characters and will need to be done manually. Use "<Russian>.*</Russian>" to replace

Testing/Debug:
  • Easiest to change languages for testing via editing: Arma3.cfg -> language="English";
  • stingtable.XML changes can be tested on unpacked file i.e. do not have to rePBO changes to test

User avatar
mad rabbit
Community God
Community God
Posts: 2155
Joined: 24 Jan 2013, 12:39
In-game Name:
Location: Melbourne, Australia

Re: Example of Localization Procedure & Notes for DEVs

Postby mad rabbit » 22 Jul 2014, 14:57

This tool may help with future localisation work:

Image

tabler - Arma 3 Translation Helper by bux578

I'd like to present to you a new tool I'm working on. It emerged from the need to translate a lot of modules of an Arma 3 Mod without having to go through the hazzle of editing every single stringtable.xml one by one. And to be honest: It's not fun to work with XML files.

tabler let's you define your mod working directory and parses every stringtable.xml file it finds in your mod's subfolders. From there you can view, modify or add translations and save all your changes back to the stringtable.xml files - with one click.

Features:
  • Open all stringtable.xml files in one UI
  • Add keys or edit translations in an Excel-like grid view
  • Save all changes back to the stringtable.xml files

Adanteh
Admin
Admin
Posts: 1502
Joined: 15 Sep 2013, 15:43
In-game Name:

Re: Example of Localization Procedure & Notes for DEVs

Postby Adanteh » 29 Aug 2014, 12:35

Posting my own way to export spreadsheets from Google Drive and creating a stringtable out of it:
  • Make sure order of colums is correct in spreadsheet (Check medical files as example)
  • File -> Download As -> CSV
  • Copy all content from CSV
  • Go to XML converter
  • Paste copied CSV formation in first text box
  • Copy following information:

    Code: Select all

        <Key ID="##2##">
           <Original>##3##</Original>
           <English>##4##</English>   
           <Czech>##5##</Czech>
           <French>##6##</French>
           <German>##7##</German>
           <Italian>##8##</Italian>
           <Polish>##9##</Polish>
           <Portuguese>##10##</Portuguese>
           <Russian>##11##</Russian>
           <Spanish>##12##</Spanish>
        </Key>   
  • Paste in template section on website (Third box)
  • Press Convert CSV to XML
  • Press copy to clipboard
  • Open or create stringtable.xml file
  • If it's a new file make sure to create needed tags first:

    Code: Select all

    <?xml version="1.0" encoding="utf-8"?>
    <Project name="ICE">
    <Package name="firstAid">
    <Container name="firstAid">
    <!-- -->
    <!-- Paste converted XML here -->
    <!-- -->
    </Container>
    </Package>
    </Project>
  • Paste in the information between the main stringtable tags.
  • Make sure to remove xml file definition and <document> tags from pasted information
  • Make sure to delete the first entry of the XML entries (Table header)
  • Do search & replace with regular expression (Comments out all unfilled languages):
    • Search for: ^( +)<(.{0,10}) \/>\n
    • Replace by: $1<!--<$2></$2>-->
  • ???
  • PROFIT

User avatar
Alonso
Community Member
Community Member
Posts: 208
Joined: 15 Mar 2014, 11:47
In-game Name:
Location: Spain

Re: Example of Localization Procedure & Notes for DEVs

Postby Alonso » 29 Aug 2014, 18:18

Mad Rabbit,

Have you given tabler a go? It looks very interesting
Image

User avatar
mad rabbit
Community God
Community God
Posts: 2155
Joined: 24 Jan 2013, 12:39
In-game Name:
Location: Melbourne, Australia

Re: Example of Localization Procedure & Notes for DEVs

Postby mad rabbit » 30 Aug 2014, 03:54

To be quite honest I've been putting off getting back into this task as much as possible as it's a "pain in the as*' and very boring. But am doing so today as I no longer have any more excuses...

Adanteh did try tabler and said he couldn't get it to work but I'll try it out myself today.

EDIT:
Just tried v0.3.1 then myself and it actually more tedious than doing it all manually with spredsheets and/or Adanteh's replacement method above. It also has troubles recognizing multiple sub-directories, let alone the 30 x PBO sub-folders we have in TacBF. It seems mainly geared at addons with a single PBO and not really a 'one-stop shop' compendium for localization. Pity.


Return to “Language Localisation Task”

Who is online

Users browsing this forum: No registered users and 1 guest