HowTo localize qatesttool environment

From Apache OpenOffice Wiki
Jump to: navigation, search


For testing of OOo functionality we are using the QATesttool. Although functionality is localization independend in most cases, the testtool environment (the scripts that actually execute the tests) need some basic information about the current localization. These are for instance:

  • information about existance of a localization (that vi_VI is a correct localization for OOo)
  • some strings to pick a string from a localized stringlist (e.g. the name of the file filter for Word 97 files)
  • default settings for localizations (e.g. CTL support is enabled per default for asian(?) languages but nor for western languages)

So - if you like to run the automated tests for your localized builds (and you should) you need to add certain information to the testtool environment.

This page is supposed to collect information about the files you need to change or add.

General information and hints

  • Take this page as a checklist and make sure you put the "initial support" in place before you start with other topics
  • Don't create just the files / patches. Try to *understand* what you do.
  • Run the testscripts step by step and learn to read the logfiles
  • Create small patches that cover a single area (Writer, Calc, XML, Framework Graphics etc) (Each area has a maintainer - if only one maintainer need to review your patches, it speeds up the work)
  • File patches via Issue Tracker. Use component qa, subcomponent testscripts.
  • Each file has a maintainer. Name an eMail of the maintainer is written in the file header. Set the maintainer to cc in your Issue.
  • You will find a list of qa engineers (including script maintainers) at DomainDeveloper#QA Engineers
  • If you like to get a quick response don't ask when a release date is near (people will be busy doing release tests ;-)
  • Have an english OOo at hand, to verify if problems are caused by your localization or if they occure in a non localized build as well
  • If you have some time read http://qa.openoffice.org/qatesttool/OOo_testtool.pdf


Provide initial support for a localization

To provide initial support for a localization, you need to tell the testtool environment, that this localization exists and the string for the OOo file filter names. This will enable you to run the first and topten tests without false errors / warnings. (See issue 73401 as example.)

This is mandatory for each localization that would be released, as the covered tests are part of the release approval process.


Important to know before you begin

Be aware that no matter how much you search the files for "iSprache" and similar variables, the only way to check that all the necessary changes have been made, is by letting every single test run. And that includes the tests you haven't changed at all. And pay attention to every single warning the tests generates. Because several scripts generates their own files for the new language. But they do not automatically copy these files to the directory where they later are needed. That's something you have to do manually, after you have checked the generated file for eventual errors.


The Modules

Module: Global

File: /global/system/inc/master.ini

  • The language needs to be added to the iJump -variable. This is done in the sub "mMakeGeneralOptions".

This variable is for setting the “work” directory in Tools – Options - Paths, with exception for Asian languages because the sequence of the listed items depends on the system locale.


File: global/system/inc/iniinfo.inc

  • This file has some basic functions to identify your localization and assigns an internal ID (a integer value that is used within the scripts)
  • Look at http://l10n.openoffice.org/languages.html see, what code and MS language ID to use for your localization
    edit iniinfo.inc - you will see some case statements in sub GetLanguageInformation, function ConvertLanguage2, function ConvertLanguage, function ConvertCodeToLanguage and function GetLanguageText. Add new lines of code for your localization.
  • Add values for the new language for the "iSprache"-variable.

This is located in the sub "GetLanguageInformation". (Look at http://l10n.openoffice.org/languages.html see, what code to use) (In this case it should be: case "vi_vi", "vi-vi", "vi" : iSprache = 84 )

Language Code ISO 639 (Country) (and ISO 3166 for language) is now gLangCode ISO 639 http://www.oasis-open.org/cover/iso639a.html ISO 3166: http://xml.coverpages.org/country3166.html

Example: Japanese The first code from ISO 639 is JA (for the country "JApan") and the one from 3166 is JP (for "JaPanese"). Since Vietnamese isn't listed in the ISO 3166, the Code from ISO is repeated. That might however be the only case where it's like that.

Also the function "ConvertCodeToLanguage" needs similar changes.


qatesttool/framework/first/input/filter.txt

  • This file defines the localized string for "All Formats" in the file open dialog
  • Add a new line with the correct string for your localization
  • The Filters (are a part of “global”, but uses a Bas-file which is placed in the Framework-directory).

File: /framework/first/input/filter.txt

    This file defines the localized string for "All Formats" in the file open dialog.
  • The file needs to be updated with a new line containing the correct string for the new localization.

This is done with the following tool: \framework\tools\t_filter.bas

File: /global/input/filters/current/OpenOffice.org/filter??.txt

This file defines filter names for current OOo default file formats. The ?? in the filename is the code of your localization (e.g. filter84.txt for Vietnamese)

  • Copy any existing file (e.g. filter1.txt) and change the strings for your localization

File: /global/input/filters/<version>/OpenOffice.org/filter??.txt (?? = the country-code)

Filter names for default file types of older OOo / SO versions. <version> needs to be replaced by the build-ID of the corresponding codeline (e.g. 569 for StarOffice 5, 645 for OOo 1.1, 680 for OOo 2 )

  • Create filter??.txt files in all of the subdirectories and enter the correctly localized strings.
  • Minimum is to create the files in 569 subdir. (These are used to test "alien format" warnings)


File: qatesttool/global/input/filters/current/OpenOffice.org/filter??.txt

  • This file defines filter names for current OOo default file formats. The ?? in the filename is the code of your localization (e.g. filter84.txt for vi_VI)
  • Copy any existing file (e.g. filter1.txt) and change the strings for your localization


File: qatesttool/global/input/filters/<version>/OpenOffice.org/filter??.txt

  • Filter names for default file types of older OOo / SO versions.
    <version> needs to be replaced by the build-ID of the corresponding codeline (e.g. 569 for StarOffice 5, 645 for OOo 1.1, 680 for OOo 2 )
  • Create filter??.txt files in all of the subdirectories and enter the correctly localized strings. Minimum is to create the files in 569 subdir. (These are used to test "alien format" warnings)


File: qatesttool/framework/first/inc/topten.inc

  • There is localization dependend code in sub CutCopyPaste
  • If your localization does 'not' use CTRL+A to "Select all", you need to define the keyboard shortcut right at the beginning of this sub


Support for release tests (update tests)

This tasks would enable your localization to run the releasetests (ooo_releasetest.sh) without warnings that are caused by missing localization in the testtool environment. This should be done for every localization that is going to be released.


Module: Base

  • There are only two update tests for Base (located at qatesttool/base/update/ - b_updt.bas and xforms_updt.bas). These have no localization specific code.

There could be warnings about missing databasetypes depending on your environment (e.g. if Evoluiton is not installed) Another warning might be caused by issue 49557.


Module: Chart

The current chart update test (qatesttool/chart/ch_updt.bas) has no localization specific code.

Please note, that implementation for a new chart module is ongoing. So the tests for chart module are likely to change.

  • For the level1-tests; Search for iSprache, run all tests, correct eventual errors.


Module: Calc

This will enable the calc update tests (located at qatesttool/calc/update/) to run in your localized environment.

The current c_updt.bas test does only inform about missing localization support, there are no warnings. So it is up to you to add the support.


calc/update/inc/c_010_.inc

  • Checks some calc functions like accesibility, autocomplete ...
  • there are four checks that need to be added (see issue 74365 as example) :
    • testcase tAutoComplete
      add a case branch to the select case statement for your language. Assign the first letters of the sum-function (including =) to firstChar$ , assign the correct name (including = and parenthesis) of the sum-function to complStr$
    • testcase tNaturalLanguage
      add a case branch to the select case statement for your language. Assign the correct name of the sum-function (including = but without parenthesis) to firstChar$
    • testcase tNextTable
      add a case branch to the select case statement for your language. Assign the default name for new sheets to ichheisse$ (e.g. in en-US the sheets are named Sheet1, Sheet2 ... -> assign "Sheet")
    • testcase tRelativAbsolut
      add a case branch to the select case statement for your language. Assign the default name for new sheets to sheettag$. Assign the name of the sum-function (without = and parenthesis) to function$


calc/update/inc/c_006_.inc

  • Checks resources for menu item tools (e.g. Spellcheck and thesaurus) ...
  • Tests for thesaurus can be added here. but ATM thesaurus tests for OOo builds are disabled (see issue 74366)

Since the Calc-tests currently are being rewritten, the language-issue might change.

Run CalcFilterNames to localize the responses in the fileOpen/close dialogues for your locale. Your new reference file is in %ApplicationData%\OpenOffice.org2\user\work\OpenOffice.orgCalcFilter50.txt.

Please verify its content (DONT TAKE ANYTHING FOR GRANTED) and copy the file to the appropriate place in your local CVS workspace (...\calc\tools\filters\). Use c_lv1_filter_names.bas to check if the filter names and positions generated are OK.

Don't forget to check it into CVS after having tested it.

Module: Framework

This will enable the general update tests for framework functionality (located at qatesttool/framework/update/) to run in your localized environment.

  • framework/update/input/autotext/names_??.txt
    • this file is a list of names of the autotexts.
    • this file will be created when you run f_updt_autotext.bat the first time. Verify the names and correct them if necessary


  • framework/update/input/scripts/680/OpenOffice.org/javascript_??.txt
    • this file is a list of names of the preinstalled java scripts .
    • this file will be created when you run f_updt_scriptnames.bat the first time. Verify the names and correct them if necessary.


  • framework/update/input/templdoc/OpenOffice.org/new_??.txt
  • framework/update/input/templdoc/OpenOffice.org/tem_??.txt
  • framework/update/input/templdoc/OpenOffice.org/ _??.txt
    • this files string lists for New Document types, templates and samples (the categories you see in the Templates and Documents dialog)
    • this files will be created when you run f_updt_templates.bas the first time. Verify the names and correct them if necessary.


Framework:

     You need to run following tests to get all localized strings copied into referencefiles. Copy them to the appropriate places in the corresponding modules. Further instructions can be found in the resultfiles to the testcases.

These filters goes to the global/input/filters directory /framework/tools/f_filters.bas

Then we have the OLE names. Note that these lists are best created using a Mircosoft (R) Windows (R) machine because the "Further Objects" might not be present on Linux/Solaris.

/global/tools/getnames.bas

These lists are framework specific and should be placed under: /framework/update/input/ /framework/update/f_updt_autotext.bas /framework/update/f_updt_scriptnames.bas /framework/update/f_updt_templates.bas /framework/update/f_updt_namescheck.bas

The extras like labels, linestyles etc. Put them under: /framework/extras/input/ /framework/extras/extras_labels.bas /framework/extras/extras_drawobjects.bas

The help. This is going to take time. Put it under: /framework/help/input/ /framework/help/help_compare_apps.bas /framework/help/help_compare_content.bas /framework/help/help_compare_topics.bas /framework/help/help_bookmarks.bas /framework/help/help_search.bas

You will also need to add/make some changes in the two following files:

  • Accelerators.txt ( \framework\tools\input\Accelerators.txt )

For respective language, this file needs to be added with respective shortcuts.

  • i18ndata.txt ( \framework\tools\input\i18ndata.txt )

Todo: This file needs to be updated with the english name (combined with the countrycode) of the new language, and the short locale for it. The same data can be found in global/system/iniinfo.inc and should be in sync.

In addition to this, Framework also administrates this Project: http://wiki.services.openoffice.org/wiki/Mnemonics_Localisation And thereby also the Test: /framework/level1/f_lvl1_menuentries.bas and the files under /framework/level1/input/menu/

The test must be run for a new language, the files must be contributed to the already existing examples in Wiki, and checked / eventually corrected. The finished Reference should then be committed to the CVS.

Module: Graphics (Draw, Impress, Gallery)

File: graphics/update/input/gallery/gal_oo_??.txt

  • This file is a list of names of the gallery themes.
  • It will be created when you run Gallery.bas the first time with the new language. Follow the instructions in the Resultfile. Verify the names and correct them if necessary (see issue 74553 as example)

File: graphics/tools/locale_1.txt

  • This file defines some strings for testing the spellchecker. There is a block of 6 strings per language
  • Run graphics/tools/makeLocaleTxt.bas to add the strings for your locale to this file. (see issue 74641 as example)

File: graphics/update/inc/global/gallery.inc

  • This includes scripts to thest general gallery functionality
  • In testcase tGallery_GalleryView_Preview and testcase tGallery_GalleryView_Insert you'll find some statements like
  select case iSprache
      case 01   : jpeg_bkg =  1 : iAnimation =  5 : iSound =  2
      case 49   : jpeg_bkg =  2 : iAnimation =  5 : iSound =  2
Here you have to add a line with the correct numbers for your own localization. For instance, the number for jpeg_bkg is the Theme-number (counting from above) for Backgrounds, or some Theme with usual Bitmaps.
The iAnimation-number should be the number for a Theme with animated Gif-files.
And the iSound-number should naturally be the Theme-number for a Theme with some kind of sound-files.
  • Run /Graphics/Level1/g_Character.bas
 Check the result in /Graphics/Level1/Input/spellb_xx  (xx = languagenumber)
  • Create new file /Graphics/Level1/Input/Silben_xx. (xx = languagenumber)
 Look at the file: /Graphics/Level1/Input/Silben_01 for an example of what the file should look like. (but in the new language, of course)
  • Run /Graphics/Level1/g_Tools.bas - And thereafter check the result-file for warnings or errors.
  • /Graphics/Level1/inc/global/g_FindReplace.inc - Add words for the new language.
  • Run /Graphics/Level1/g_FindReplace.Bas - And thereafter check the result-file for warnings or errors.
  • /Graphics/Level1/inc/global/g_Spellcheck.inc - Add words for the new language.
  • Run /Graphics/Level1/g_Spellcheck.Bas - And thereafter check the result-file for warnings or errors.
  • /Graphics/Level1/inc/global/g_Autocorrection.inc - Add words for the new language.
  • Run /Graphics/Level1/g_Autocorrection.Bas - And thereafter check the result-file for warnings or errors.


Module: Writer

This will enable all the writer update tests (located at qatesttool/writer/update/) to run in your localized environment ( See issue 74274 as example.)


writer/update/inc/w_002_.inc

  • This file is used to test Writer edit actions (found in the menu Edit and Insert)
  • In testcase tEditFields you'll see two "Select case iSprache" statements.
    You need to add two case branches for your localization (identified by the numeric language code). The numbers for Feldtyp.Select and Auswahl.Select are the indexes for "Sender" and "Company" in the Insert - Fields - Other... dialog.
  • In the "Writer"-directory: Search for "iSprache".

Add the strings and language-specific information for the new language. (use the web / a dictionary to find correctly spelled words / sentences)
Directory '..writer/tools' holds an test called 'w_get_locale_strings.bas' which returns strings needed in 'w_fields.bas', 'w_table.bas' and Load-Save-Tests. Run this test on Office installation using your language to be localized. Currently there is an effort to have centralized localization files. First of it is 'writer/tools/w_locale_strings1.inc' that holds strings for 'w_table.bas'.

Module: Math

  • Update test: The current math update test (qatesttool/math/update/m_updt.bas) has no localization specific code.
  • Level1-tests: - Test-print the file /math/level1/input/101_2.sxw
 The result of the second page printed should not contain any underscores or dots. 1string (Alpha, Beta, Chi etc -signs should be fully readable)
  • Search the Math-directories for iSprache, run all Math-tests, correct eventual errors.


Module: XML

The current XML update test (xml/update/oasis_graphics_update.bas) has no localization specific code. Depending on your build there might be a warning about missing URL for online Update.


Other Tests

(this is still work in progress)


Examples of Code which is Language-dependant, and will have to be modified / added with new strings

Examples for what kind of code-parts one needs to change for the tests to work with a new language: Since it doesn't exist a specific tag-word for the places where the script contain language-dependant code, it comes in handy to know what to look for, when testing a new language.


File: /writer/level1/inc/formatpage/w_formatpage3.inc

        case 01   : sHeader = "Header"
        case 49   : sHeader = "Kopfzeile"

Todo: Here you have to specify the variable "sHeader" for the new language. It's simply the country-code.

'------------------------------------------------------------------------------------------

File: /writer/level1/inc/global/w_102_.inc

        Case 01,1: WhereIsOutline = 19
        Case 86: WhereIsOutline = 35

Todo: In the testcase "tEditFindAndReplace" the variable "WhereIsOutline" has to be specified. The value matches the

'------------------------------------------------------------------------------------------

File: /writer/level1/inc/number/w_205a_.inc

        From testcase "tToolsOutlineNumbering2"
        if iSprache = 01 then
           VorlagenLst (i) = Absatzvorlage.GetItemText ( i+1 )
        else
           VorlagenLst (i) = Absatzvorlage.GetItemText ( i+2 )
        end if

- This code might cover all possibilities, but one can never be sure about it.

'------------------------------------------------------------------------------------------

File: /writer/level1/inc/option/wr_o_3.inc

        *testcase tToolsOptionsAutocaption
        Select Case iSprache
               case 36     :   SplitString = "-"
               case else   :   SplitString = " "
        end select
     ...
        Select Case iSprache
               Case 31   :  Call wDokSchreiben ("<Mod1 Shift Right>", 3)
               Case else :  Call wDokSchreiben ("<Mod1 Shift Right>")
        end select

'------------------------------------------------------------------------------------------

File: /writer/level1/inc/Regexp/search.inc

        case 01 : Shortcut = "<Mod1 f>"
        case 03 : Shortcut = "<Mod1 g>"
        sub Meldungs_Test
            Case 01 : Text_In_Meldung = "StarOffice Writer has searched to the end of the document. Do you want to continue at the beginning?"
            Case 33 : Text_In_Meldung = "StarOffice Writer a atteint la fin du document. Souhaitez-vous reprendre la recherche au début du document ?"
            Case 55 : Text_In_Meldung = "StarOffice Writer pesquisou até o final do documento. Deseja continuar do início?"

'------------------------------------------------------------------------------------------

File: /writer/level1/inc/section/w_section_4.inc

        testcase tParagraphSection_2
        if iSprache = 82 then
           Call wDokSchreiben "<Return>"
        endif

'------------------------------------------------------------------------------------------

File: /writer/level1/inc/stylist/w_stylist.inc

Todo: Add the Stylist-strings for the new language.

testcase tAssigningStyles1

       Case 01 : sStyles = Array("Clear formatting", "Default", "Heading 1", "Heading 2", "Heading 3", "Text body", "More...")
       Case 31 : sStyles = Array("Opmaak wissen", "Kop 1", "Kop 2", "Kop 3", "Standaard", "Tekstblok", "Meer...")
       Case 33 : sStyles = Array("Effacer le formatage", "Corps de texte", "Par défaut", "Titre 1", "Titre 2", "Titre 3", "Autres...")

'------------------------------------------------------------------------------------------

File: /writer/loadsave/inc/filter/w_filter.inc

Todo: Add filter-list-file to \writer\loadsave\input\filter\

This is done with the scripts: "tCollectSaveAsFilter" und "tCollectExportFilters" (Which are also found in writer\loadsave\inc\filter\w_filter.inc)

(This is a work in progress)

Personal tools
In other languages