{
[XmlAttribute("code")]
public string Code { get; set; }
- [XmlAttribute("name_en")]
- public string EnglishName { get; set; }
[XmlAttribute("name_local")]
public string LocalName { get; set; }
- [XmlAttribute("message")]
- public string Message { get; set; }
}
-}
\ No newline at end of file
+}
<?xml version="1.0"?>
<languages>
- <language code="ko_KR" name_en="Korean" name_local="한국어" message="언어 선택" />
- <language code="en_US" name_en="English (US)" name_local="English" message="Select your language" />
- <language code="pl_PL" name_en="Polish" name_local="Polski" message="Wybierz swój język" />
+ <language code="ko_KR" name_local="한국어" />
+ <language code="en_US" name_local="English" />
+ <language code="pl_PL" name_local="Polski" />
</languages>
{
[XmlAttribute("code")]
public string CountryCode { get; set; }
- [XmlAttribute("name")]
+ [XmlAttribute("name_en")]
public string Name { get; set; }
- [XmlAttribute("timezone")]
- public string Timezone{ get; set; }
- [XmlAttribute("cityname")]
- public string CityName { get; set; }
- [XmlAttribute("id")]
- public string Id { get; set; }
-
}
}
{
public class RegionManager
{
- private const string CountryCodeVconfKey = "db/setting/country_code";
- private const string CityNameIdVconfKey = "db/setting/cityname_id";
-
public RegionManager()
{
var filename = Tizen.Applications.CoreApplication.Current.DirectoryInfo.Resource + "regions_OOBE.xml";
{
get
{
- return Regions.Single(s => s.Timezone == Vconf.GetString(CountryCodeVconfKey));
+ return Regions.Single(s => s.CountryCode == SystemSettings.LocaleCountry);
}
set
{
if (value != null)
{
- SystemSettings.LocaleTimeZone = value.Timezone;
SystemSettings.LocaleCountry = value.CountryCode;
- try {
- Vconf.SetString(CountryCodeVconfKey, value.CountryCode);
- Vconf.SetString(CityNameIdVconfKey, value.CityName);
- }
- catch (Exception e)
- {
- Tizen.Log.Debug("oobe", $"setting vconf keys failed: {e.Message}");
- }
}
}
}
foreach (RegionInfo info in manager.Regions)
{
CarouselPickerItemData item = new CarouselPickerItemData();
- item.TranslatableText = info.Id;
+ item.TranslatableText = info.Name;
carousel.AddItem(item);
}
<?xml version="1.0"?>
<regions>
- <region code="en_GB" name="United Kingdom" timezone="Europe/London" id="UNITED_KINGDOM" />
- <region code="ko_KR" name="South Korea" timezone="Asia/Seoul" id="SOUTH_KOREA" />
- <region code="pl_PL" name="Poland" timezone="Europe/Warsaw" id="POLAND" />
+ <region code="en_GB" name_en="UNITED_KINGDOM" />
+ <region code="ko_KR" name_en="SOUTH_KOREA" />
+ <region code="pl_PL" name_en="POLAND" />
</regions>
# OOBE
+
+## Adding new languages
+The language list is loaded from xml file placed in
+Oobe/Oobe.Language/res/languages_OOBE.xml
+
+To add new language add an xml node
+```
+ <language code="pl_PL" name_local="Polski" />
+```
+Where:
+"code" - follows the <LANGUAGE>_<REGION> syntax. The language setting is in the ISO 639-2 format and the region setting is in the ISO 3166-1 alpha-2 format
+"name_local" - language native name
+
+## Adding new regions
+The country list is loaded from xml file placed in
+Oobe/Oobe.Region/res/regions_OOBE.xml
+
+To add new language add an xml node
+```
+ <region code="pl_PL" name_en="POLAND" />
+```
+Where:
+"code" - follows the <LANGUAGE>_<REGION> syntax. The language setting is in the ISO 639-2 format and the region setting is in the ISO 3166-1 alpha-2 format
+"name_en" - the english name of item. It will be used as key for translations
+defined in Oobe/Oobe.Common/Resources/Translations.resx