Issue 128386 - Letter Wizard - "unknown Language" item
Summary: Letter Wizard - "unknown Language" item
Status: CONFIRMED
Alias: None
Product: General
Classification: Code
Component: ui (show other issues)
Version: 4.1.7
Hardware: PC Windows, all
: P5 (lowest) Minor (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-03 16:16 UTC by Czesław Wolański
Modified: 2023-02-12 13:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.13
Developer Difficulty: ---


Attachments
Relevant screenshot (417.19 KB, image/jpeg)
2020-06-03 16:16 UTC, Czesław Wolański
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Czesław Wolański 2020-06-03 16:16:10 UTC
Created attachment 86955 [details]
Relevant screenshot

Steps to demonstrate:

1. launch AOO
2. choose menu 'File > Wizards > Letter'
   (Letter Wizard dialog appears, step 1. "Page design")
3. Go to Step 3. "Printed items"
4. drop-down list labeled: "Use a typical letter format this country:"
   has an item with name: "unknown Language"

Relevant screenshots are in attached file "unknownLanguage".


Note:
1. Issue observed in both AOO 4.1.7 and AOO 4.2.0-dev
2. US-English build of AOO, with language packs installed: DE, FR, PL, RU
Comment 1 Matthias Seidel 2020-06-03 20:08:14 UTC
Confirmed on Windows 10 and Ubuntu 16.04. Both German.
Comment 2 Matthias Seidel 2020-06-03 20:11:53 UTC
I think this untranslated string is here:

https://github.com/apache/openoffice/blob/trunk/main/wizards/com/sun/star/wizards/letter/LocaleCodes.java#L44

I don't know how we can get it into Pootle...
Comment 3 Czesław Wolański 2023-02-12 10:31:06 UTC
(In reply to Matthias Seidel from comment #2)
> I don't know how we can get it into Pootle...
Neither do I.


The question remains: why OpenOffice displays "unknown Language" at all?

The letter templates for this item come from the "es" folder
in share\template\wizard\letter
All internal meta.xml files contain the entry:
<dc:language>es-ES</dc:language>.
Documents created from these templates are in Spanish.

Looking at the source code in
/main/wizards/com/sun/star/wizards/letter/
(mainly file LetterWizardDialogImpl.java ---> LocaleCodes.java):
Perhaps the problem is related to different values ​​assigned to
"Spanish (Spain)"?

---------------------------------

file: LocaleCodes.java


36      public LocaleCodes(XMultiServiceFactory xmsf)
37      {
38          super(xmsf, UNIT_NAME, MODULE_NAME);
39          allLanguageStrings = getStringList(16638);  // STR_ARR_SVT_LANGUAGE_TABLE from svtools/source/misc/langtab.src
40      }

---------------------------------

file: langtab.src

28 #include <i18npool/lang.h>

163 		< "Spanish (Spain)" ; LANGUAGE_SPANISH ; > ;


---------------------------------

file: lang.h


321  #define LANGUAGE_SPANISH_DATED              0x040A  /* old collation, not supported, see #i94435# */
 
334  #define LANGUAGE_SPANISH_MODERN             0x0C0A

343  #define LANGUAGE_SPANISH                    LANGUAGE_SPANISH_MODERN     /* modern collation, see #i94435# */


Issue 94435 mentioned in comments
("Spanish "Modern", not possible to provide a spell-checker for it...")
dealt with LANGUAGE_SPANISH (0x040A = 1034) and
LANGUAGE_SPANISH_MODERN (0x0C0A = 3082)
both mapped to/from the locale of es_ES.


Back to the file LocaleCodes.java 

42  public String getLanguageString(String MSID)
43  {
44    String LS = "unknown Language";
45    for (int i = 0; i < allLanguageStrings.length; i++)
46    {
47      if (allLanguageStrings[i].Value.toString().equalsIgnoreCase(MSID))
48      {
49         LS = allLanguageStrings[i].Name;
50      }
51    }
52    return LS;
53  }      



The value "1034" on one side, "3082" on the other.
Comment 4 Czesław Wolański 2023-02-12 13:58:53 UTC
(In reply to Czesław Wolański from comment #3)
> The value "1034" on one side, "3082" on the other.
"1034" in file LocaleCodes.java

156          Ids[97] = "Spanish - Spain;es-es;1034";