Language in CumulusUtils: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
mNo edit summary
 
(4 intermediate revisions by the same user not shown)
Line 9: Line 9:
The choice has been made to use the [https://docs.microsoft.com/en-gb/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f Windows Language Code Identifier (LCID) Reference] (you will find the codes in this [https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-LCID/%5bMS-LCID%5d.pdf pdf document]) with only the five position codes as valid. So for British English the code '''en-GB''' is used. The first two digits determine the language, the last two digits determine the country and therefore the [https://en.wikipedia.org/wiki/Locale_(computer_software) locale].  
The choice has been made to use the [https://docs.microsoft.com/en-gb/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f Windows Language Code Identifier (LCID) Reference] (you will find the codes in this [https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-LCID/%5bMS-LCID%5d.pdf pdf document]) with only the five position codes as valid. So for British English the code '''en-GB''' is used. The first two digits determine the language, the last two digits determine the country and therefore the [https://en.wikipedia.org/wiki/Locale_(computer_software) locale].  


NOTE: be aware, that using a locale different from the one used for CumulusMX you may run into problems. Especially the abbreviated month names cause trouble because they are used for creating the file names for the monthly log files. If you doe not seem to be able to solve the issue, please contact [https://cumulus.hosiene.co.uk/memberlist.php?mode=viewprofile&u=9016 @HansR] on the forum.
NOTE: be aware, that using a locale different from the one used for CumulusMX you may run into problems. Especially the abbreviated month names cause trouble because they are used for creating the file names for the monthly log files. If you do not seem to be able to solve the issue, please contact [https://cumulus.hosiene.co.uk/memberlist.php?mode=viewprofile&u=9016 @HansR] on the forum.
'''See: [[Language_in_CumulusUtils#Trouble_in_Paradise|Trouble in Paradise]].'''
'''See: [[Language_in_CumulusUtils#Trouble_in_Paradise|Trouble in Paradise]].'''


Any entry of a language code other than five digits or invalid language or country will trigger an error and fall back to the default en-GB.  
Any entry of an illegal locale code will trigger an error and fall back to the default en-GB.  


Both the [[CumulusUtils Gauges]] and the [[CumulusUtils Graphs]] (made with [https://www.highcharts.com/ HighCharts]) have their own language subsystem. If anywhere the languages don't match it is seen as an error with a fall back to the default of en-GB. The gauges language file (''language.js'') is part of the gauges subsystem but can be modified in concertation with [https://cumulus.hosiene.co.uk/memberlist.php?mode=viewprofile&u=2711 Mark Crossley] who then will put it back into the gauges repository and I will take it up in the ''CumulusUtils'' distribution. An example of this is the the now presence of two Norwegian languages. A new language must also be acknowledged by [https://cumulus.hosiene.co.uk/memberlist.php?mode=viewprofile&u=9016 HansR] for ''CumulusUtils'' to make the new language code accepted.
Both the [[CumulusUtils Gauges]] and the [[CumulusUtils Graphs]] (made with [https://www.highcharts.com/ HighCharts]) have their own language subsystem. If anywhere the languages don't match it is seen as an error with a fall back to the default of en-GB. The gauges language file (''language.js'') is part of the gauges subsystem but can be modified in concertation with [https://cumulus.hosiene.co.uk/memberlist.php?mode=viewprofile&u=2711 Mark Crossley] who then will put it back into the gauges repository and I will take it up in the ''CumulusUtils'' distribution. An example of this is the the now presence of two Norwegian languages.  
 
In CUtils the gauges languages are determined through the locale. If the language from the locale does not exist it falls silently back to en-GB


The current languages defined and accepted are:
The current languages defined and accepted are:
     EN, FR, DE, NL, SE, DK, FI, NN, NB, IT, ES, CT, GR, PT, CS, PL
     EN, FR, DE, NL, SE, DA, FI, NN, NB, IT, ES, CT, GR, PT, CS, PL


== Output ==
== Output ==
Line 27: Line 29:


== Locale ==
== Locale ==
One other feature of the language setting is that it defines the Locale used within ''CumulusUtils'' i.e. which ''Culture settings'' will be used. This is specifically important for the number separators as comma's and points. The output of numbers will follow the specified locale within ''CumulusUtils''.
From version 6.19.0 the ''Locale'' has become the central parameter and is defined through the ''Language'' parameter e.g. Language=nl-NL (unfortunate but historically determined).
 
If the ''locale'' is invalid, it is defaulted to ''en-GB''.  
 
The ''Locale'' determines the ''language'' and ''country'' settings for ''CUtils''. All module and website output of dates and numbers are governed by the ''Locale''. The user has no other configuration possibility to choose forrmat of dates and numbers. It is what it is.


== Trouble in Paradise ==
== Trouble in Paradise (for version < 7.0.0) ==
One design feature of ''CumulusMX'' is that the Locale is used in the file naming of the monthly logfiles of ''CumulusMX''. This leads sometimes to problems: if the Locale used for ''CumulusUtils'' is different from the Locale used by ''CumulusMX'', the monthly logs cannot be read in some cases. In this case the user can make use of the inifile parameter  
One design feature of ''CumulusMX'' is that the Locale is used in the file naming of the monthly logfiles of ''CumulusMX''. This sometimes leads to problems: if the Locale used for ''CumulusUtils'' is different from the Locale used by ''CumulusMX'', the monthly logs cannot be read in some cases. In this case the user can make use of the inifile parameter  
     MonthsOfMiracleAndWonder=jan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec
     MonthsOfMiracleAndWonder=jan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec
which is defaulted with the abbreviated month names for the locale used by ''CumulusUtils''. Changing these abbreviated month names to the ones used by ''CumulusMX'' will solve that issue.
which is defaulted with the abbreviated month names for the locale used by ''CumulusUtils''. Changing these abbreviated month names to the ones used by ''CumulusMX'' will solve that issue.


If you change the Locale of ''CumulusUtils'', you may have to remove this parameter to reset it and change the defaults again.
If you change the Locale of ''CumulusUtils'' or of the machine on which you run CumulusMX (causing a change of filenames for the monthly logs), you may have to remove this parameter to reset it and change the defaults again or you may have to change the month abbreviations to what is expected.


[[Category:CumulusUtils]]
[[Category:CumulusUtils]]

Navigation menu