SmingLocale.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * SmingLocale.h
8  *
9  * Localization is defined within SmingLocale.h
10  * Each locale has a unique ID (usually its international dial code, e.g. GB=44
11  * The default locale is GB and the default values are those used by GB.
12  * To add a new locale:
13  * #define LOCALE_xx_yy zz (where xx_yy is the locale identifier and zz is the IDC)
14  * Override any variation from GB settings within a "#elifdef LOCALE_xx_yy zz" block
15  * Default settings are at end of file
16  */
17 
18 #pragma once
19 
20 // Define unique values for each locale (try to use ISD codes if appropriate)
21 #define LOCALE_EN_US 1
22 #define LOCALE_FR_FR 33
23 #define LOCALE_EN_GB 44
24 #define LOCALE_DE_DE 49
25 #define LOCALE_EN_AU 61
26 
27 #ifndef LOCALE
28 #define LOCALE LOCALE_EN_GB
29 #endif // LOCALE
30 
31 #if LOCALE == LOCALE_EN_US
32 
33 #define LOCALE_DATE "%m/%d/%Y"
34 #define LOCALE_DATE_TIME "%a %b %d %H:%M:%S %Y"
35 
36 #elif LOCALE == LOCALE_FR_FR
37 
38 #define LOCALE_MONTH_NAMES \
39  "janvier\0f�vrier\0mars\0avril\0mai\0juin\0juillet\0ao�t\0septembre\0octobre\0novembre\0d�cembre"
40 #define LOCALE_DAY_NAMES "dimanche\0lundi\0mardi\0mercredi\0jeudi\0vendredi\0samedi"
41 
42 #elif LOCALE == LOCALE_DE_DE
43 
44 #define LOCALE_MONTH_NAMES \
45  "Januar\0Februar\0M�rz\0April\0Mai\0Juni\0Juli\0August\0September\0Oktober\0November\0Dezember"
46 #define LOCALE_DAY_NAMES "Sonntag\0Montag\0Dienstag\0Mittwoch\0Donnerstag\0Freitag\0Samstag"
47 #define LOCALE_DATE "%d.%m.%Y"
48 
49 #elif LOCALE == LOCALE_EN_AU
50 
51 // Australia is same as GB
52 
53 #endif // LOCALE
54 
55 // Defaults (GB)
56 #ifndef LOCALE_MONTH_NAMES
57 // String array with full month names, starting with January, separated by '\0'
58 #define LOCALE_MONTH_NAMES \
59  "January\0February\0March\0April\0May\0June\0July\0August\0September\0October\0November\0December"
60 #endif // LOCALE_MONTH_NAMES
61 
62 #ifndef LOCALE_DAY_NAMES
63 // String array with full day names, starting with Sunday, separated by '\0'
64 #define LOCALE_DAY_NAMES "Sunday\0Monday\0Tuesday\0Wednesday\0Thursday\0Friday\0Saturday"
65 #endif // LOCALE_DAY_NAMES
66 
67 #ifndef LOCALE_DATE
68 // String with short date format (see DateTime::format for options - this implements %x format)
69 #define LOCALE_DATE "%d/%m/%Y"
70 #endif // LOCALE_DATE
71 
72 #ifndef LOCALE_TIME
73 // String with time format (see DateTime::format for options - this implements %X format)
74 #define LOCALE_TIME "%H:%M:%S"
75 #endif // LOCALE_TIME
76 
77 #ifndef LOCALE_DATE_TIME
78 // String with time and date format (see DateTime::format for options - this implements %c format)
79 #define LOCALE_DATE_TIME "%a %d %b %Y %X"
80 #endif // LOCALE_DATE_TIME