Language XML file

Hi all,

I'm stuck with this and I need some help. :slight_smile:
Trying to fix some mistakes in hr_HR.xml file used for our locale setup, but I don't understand few strings, nor they are explained good in manual.
Here is our locale file: http://opengrok.libreoffice.org/xref/core/i18npool/source/localedata/data/hr_HR.xml

1. Long dates:
       <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator> - my guess this means separator after "monday, "?
       <LongDateDaySeparator>. </LongDateDaySeparator> - does this reffer to "1." or "first."?
       <LongDateMonthSeparator> </LongDateMonthSeparator> - writing month as an string and not number is ok
       <LongDateYearSeparator> </LongDateYearSeparator> - does this reffer to "2013" or "two thousand and thirteen"?

2. Format Element:
formatindex="16" - according to manual, formatindex value should be from 0 to 49 except I cannot use numbers 10, 11, 48 and 49. Can I go above 49? I wanted to add some formatting, but all numbers are taken. Also, can I assign number however I want, or there are some rules?

     <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
       <FormatCode>#.##0,00 CCC</FormatCode>
     </FormatElement>
     <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
       <FormatCode>#.##0,-- [CURRENCY];[RED]-#.##0,-- [CURRENCY]</FormatCode>
     </FormatElement>

Can someone explain this 2 currency formattings to me? I don't understand what does CCC means in first formatting, and what does ,-- means in second?

Thank you!
Mihovil

Hi Mihovil,

I'm stuck with this and I need some help. :slight_smile:
Trying to fix some mistakes in hr_HR.xml file used for our locale
setup, but I don't understand few strings, nor they are explained
good in manual.
Here is our locale file: http://opengrok.libreoffice.org/xref/core/i18npool/source/localedata/data/hr_HR.xml

1. Long dates:
      <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator> -
my guess this means separator after "monday, "?

Yes, correct.

      <LongDateDaySeparator>. </LongDateDaySeparator> - does this
reffer to "1." or "first."?

1.

      <LongDateMonthSeparator> </LongDateMonthSeparator> - writing
month as an string and not number is ok

That is the separator used after the month name in a long date, e.g. in
Monday July 8, 12:37
the space after July.

      <LongDateYearSeparator> </LongDateYearSeparator> - does this
reffer to "2013" or "two thousand and thirteen"?

2013, this usually is only important for locales that in a long date
write the year first.

The separators are used when parsing long dates, not when displaying
dates which is done with the format codes.

2. Format Element:
formatindex="16" - according to manual, formatindex value should be
from 0 to 49 except I cannot use numbers 10, 11, 48 and 49. Can I go
above 49?

Yes, >=50 can be freely assigned.

I wanted to add some formatting, but all numbers are
taken. Also, can I assign number however I want, or there are some
rules?

Best to just start at 50 and continue with incrementing by one. You can
also reorder numbers between versions, the restrictions about fixed
meanings apply only to the first 50 formats.

    <FormatElement msgid="CurrencyFormatskey5" default="false"
type="medium" usage="CURRENCY" formatindex="16">
      <FormatCode>#.##0,00 CCC</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey6" default="false"
type="medium" usage="CURRENCY" formatindex="17">
      <FormatCode>#.##0,-- [CURRENCY];[RED]-#.##0,--
[CURRENCY]</FormatCode>
    </FormatElement>

Can someone explain this 2 currency formattings to me? I don't
understand what does CCC means in first formatting,

The CCC is replaced by the currency ID (e.g. EUR) of the currently
active locale. This keyword exists only for backward compatibility and
should not be used otherwise as it depends on the active locale what
currency is displayed, which is quite nonsense.. Currency format codes
should use the [$-<currencysymbol><langid>] or [$<currencyid>] instead.

and what does ,-- means in second?

That for non-cent amounts displays ,-- instead of ,00 i.e. displays dash
instead of 0, e.g. 123,-- and 123,45

I just added a pointer to
http://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/i18n/NumberFormatIndex.idl
in the
http://opengrok.libreoffice.org/xref/core/i18npool/source/localedata/data/locale.dtd
file.

  Eike

Dana 8.7.2013. 13:17, Eike Rathke je napisao:

I wanted to add some formatting, but all numbers are
taken. Also, can I assign number however I want, or there are some
rules?

Best to just start at 50 and continue with incrementing by one. You can
also reorder numbers between versions, the restrictions about fixed
meanings apply only to the first 50 formats.

Thank you, your input helps a lot!

Just interested in one more thing about quoted text above.
Can I rearrange formatindex numbers from 0-49 (with exception of those 10, 11, 48, 49)?
Would like to arrange them better, to place similliar formattings together.

If I understood correctly, they are arranged in UI based on their formatindex number. Or is there some other way to define sort order in UI (msgid="CurrencyFormatskey5" for example)?

Best regards,
Mihovil

Hi Mihovil,

Dana 8.7.2013. 13:17, Eike Rathke je napisao:
>>I wanted to add some formatting, but all numbers are
>>taken. Also, can I assign number however I want, or there are some
>>rules?
>Best to just start at 50 and continue with incrementing by one. You can
>also reorder numbers between versions, the restrictions about fixed
>meanings apply only to the first 50 formats.
>
Thank you, your input helps a lot!

Just interested in one more thing about quoted text above.
Can I rearrange formatindex numbers from 0-49 (with exception of
those 10, 11, 48, 49)?

The index numbers <50 can't be used differently, if that is what you
were asking.

Would like to arrange them better, to place similliar formattings together.

Please don't, having them sorted in the formatindex order serves to
easier compare these elements between different locales.

If I understood correctly, they are arranged in UI based on their
formatindex number. Or is there some other way to define sort order
in UI (msgid="CurrencyFormatskey5" for example)?

No (or not yet), the msgid attribute could be used for that in future,
but that's not implemented. Actually the msgid currently is just an
arbitrary name that is not evaluated.

  Eike

Dana 8.7.2013. 15:29, Eike Rathke je napisao:

Would like to arrange them better, to place similliar formattings together.

Please don't, having them sorted in the formatindex order serves to
easier compare these elements between different locales.

My whole point of changing formatindex was to better arrange formattings in UI, to group similliar formattings together, but I guess I can't do that.

Thank you for help. I will add new formattings on 50 and numbers after that and won't sort them.

Best regards,
Mihovil