diff options
author | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 00:56:40 +0900 |
---|---|---|
committer | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 00:56:40 +0900 |
commit | 4d45021a54cea98b8168b63a22ebb1d55d0773cb (patch) | |
tree | 47481d160ced6039e2037944e9c49e4ea47c9e33 | |
parent | 38e8b05a087cfa82fea4a4f9791e1201640dd98a (diff) | |
download | MultiLanguage-tizen_2.0.tar.gz MultiLanguage-tizen_2.0.tar.bz2 MultiLanguage-tizen_2.0.zip |
Tizen 2.0 Releasesubmit/tizen_2.0/20130215.192301tizen_2.0
74 files changed, 980 insertions, 0 deletions
@@ -0,0 +1,206 @@ +Flora License + +Version 1.0, May, 2012 + +http://www.tizenopensource.org/license + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and +all other entities that control, are controlled by, or are +under common control with that entity. For the purposes of +this definition, "control" means (i) the power, direct or indirect, +to cause the direction or management of such entity, +whether by contract or otherwise, or (ii) ownership of fifty percent (50%) +or more of the outstanding shares, or (iii) beneficial ownership of +such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, +and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, +made available under the License, as indicated by a copyright notice +that is included in or attached to the work (an example is provided +in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, +that is based on (or derived from) the Work and for which the editorial +revisions, annotations, elaborations, or other modifications represent, +as a whole, an original work of authorship. For the purposes of this License, +Derivative Works shall not include works that remain separable from, +or merely link (or bind by name) to the interfaces of, the Work and +Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor +for inclusion in the Work by the copyright owner or by an individual or +Legal Entity authorized to submit on behalf of the copyright owner. +For the purposes of this definition, "submitted" means any form of +electronic, verbal, or written communication sent to the Licensor or +its representatives, including but not limited to communication on +electronic mailing lists, source code control systems, and issue +tracking systems that are managed by, or on behalf of, the Licensor +for the purpose of discussing and improving the Work, but excluding +communication that is conspicuously marked or otherwise designated +in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +"Tizen Certified Platform" shall mean a software platform that complies +with the standards set forth in the Compatibility Definition Document +and passes the Compatibility Test Suite as defined from time to time +by the Tizen Technical Steering Group and certified by the Tizen +Association or its designated agent. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work +solely as incorporated into a Tizen Certified Platform, where such +license applies only to those patent claims licensable by such +Contributor that are necessarily infringed by their Contribution(s) +alone or by combination of their Contribution(s) with the Work solely +as incorporated into a Tizen Certified Platform to which such +Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim +in a lawsuit) alleging that the Work or a Contribution incorporated +within the Work constitutes direct or contributory patent infringement, +then any patent licenses granted to You under this License for that +Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof pursuant to the copyright license +above, in any medium, with or without modifications, and in Source or +Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works + a copy of this License; and + 2. You must cause any modified files to carry prominent notices stating + that You changed the files; and + 3. You must retain, in the Source form of any Derivative Works that + You distribute, all copyright, patent, trademark, and attribution + notices from the Source form of the Work, excluding those notices + that do not pertain to any part of the Derivative Works; and + 4. If the Work includes a "NOTICE" text file as part of its distribution, + then any Derivative Works that You distribute must include a readable + copy of the attribution notices contained within such NOTICE file, + excluding those notices that do not pertain to any part of + the Derivative Works, in at least one of the following places: + within a NOTICE text file distributed as part of the Derivative Works; + within the Source form or documentation, if provided along with the + Derivative Works; or, within a display generated by the Derivative Works, + if and wherever such third-party notices normally appear. + The contents of the NOTICE file are for informational purposes only + and do not modify the License. + +You may add Your own attribution notices within Derivative Works +that You distribute, alongside or as an addendum to the NOTICE text +from the Work, provided that such additional attribution notices +cannot be construed as modifying the License. You may add Your own +copyright statement to Your modifications and may provide additional or +different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works +as a whole, provided Your use, reproduction, and distribution of +the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Flora License to your work + +To apply the Flora License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "[]" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Flora License, Version 1.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.tizenopensource.org/license + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + @@ -0,0 +1,4 @@ +Copyright (c) Samsung Electronics Co., Ltd. All rights reserved. +Except as noted, this software is licensed under Flora License, Version 1. +Please, see the LICENSE file for Flora License terms and conditions. + diff --git a/description.xml b/description.xml new file mode 100755 index 0000000..d1f491d --- /dev/null +++ b/description.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<?xml-stylesheet type="text/xsl" href="../../../../description.xsl"?> + +<Overview version="0.17.1"> + <SampleName> MultiLanguage </SampleName> + <SampleVersion>1.0</SampleVersion> + <Preview>screenshot.png</Preview> + <Description>The MultiLanguage sample application demonstrates how an application can be localized to use different languages in the UI based on the language setting of the device.</Description> +</Overview> diff --git a/project/data/nofile.dummy b/project/data/nofile.dummy new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/project/data/nofile.dummy diff --git a/project/inc/MainForm.h b/project/inc/MainForm.h new file mode 100644 index 0000000..6ac3f51 --- /dev/null +++ b/project/inc/MainForm.h @@ -0,0 +1,45 @@ +// +// Tizen Native SDK +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.tizenopensource.org/license +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef _MAIN_FORM_H_ +#define _MAIN_FORM_H_ + +#include <FBase.h> +#include <FUi.h> + +class MainForm + : public Tizen::Ui::Controls::Form +{ +public: + MainForm(void); + virtual ~MainForm(void); + + bool Initialize(void); + virtual result OnInitializing(void); + virtual result OnTerminating(void); + virtual result OnDraw(void); + +protected: + const static int ID_EXIT =100; + +private: + Tizen::Ui::Controls::Label* __pValueLabel; + Tizen::Ui::Controls::Label* __pHelloLabel; +}; + + +#endif diff --git a/project/inc/MultiLanguage.h b/project/inc/MultiLanguage.h new file mode 100644 index 0000000..5d4fc95 --- /dev/null +++ b/project/inc/MultiLanguage.h @@ -0,0 +1,51 @@ +// +// Tizen Native SDK +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.tizenopensource.org/license +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef _MULTI_LANGUAGE_H_ +#define _MULTI_LANGUAGE_H_ + + +#include <FApp.h> +#include <FBase.h> +#include <FSystem.h> + +class MultiLanguage + : public Tizen::App::UiApp + , public Tizen::System::IScreenEventListener + , public Tizen::System::ISettingEventListener +{ +public: + static Tizen::App::UiApp* CreateInstance(void); + + MultiLanguage(void); + virtual ~MultiLanguage(void); + + virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry); + virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false); + virtual void OnForeground(void); + virtual void OnBackground(void); + virtual void OnLowMemory(void); + virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel); + virtual void OnScreenOn (void); + virtual void OnScreenOff (void); + virtual void OnSettingChanged(Tizen::Base::String& key); + +private: + class MainForm *__pMainForm; +}; + +#endif //_MULTI_LANGUAGE_H_ diff --git a/project/manifest.xml b/project/manifest.xml new file mode 100755 index 0000000..4c2eb03 --- /dev/null +++ b/project/manifest.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<Manifest xmlns="http://schemas.tizen.org/2012/12/manifest"> + <Id>$(manifestAppId)</Id> + <Version>1.0.0</Version> + <Type>C++App</Type> + <Author/> + <Descriptions> + <Description Locale="eng-GB"/> + </Descriptions> + <Requirements> + <Feature Name="http://tizen.org/feature/platform.core.cpu.arch">x86</Feature> + <Feature Name="http://tizen.org/feature/platform.core.fpu.arch">vfpv3</Feature> + </Requirements> + <Apps> + <ApiVersion>2.0</ApiVersion> + <Privileges> + <Privilege>http://tizen.org/privilege/alarm</Privilege> + </Privileges> + <UiApp Main="True" MenuIconVisible="True" Name="$(projectName)"> + <UiScalability BaseScreenSize="Normal" CoordinateSystem="Logical" LogicalCoordinate="480"/> + <UiTheme SystemTheme="White"/> + <DisplayNames> + <DisplayName Locale="eng-GB">$(projectName)</DisplayName> + </DisplayNames> + <Icons> + <Icon Section="MainMenu" Type="Xhigh">mainmenu.png</Icon> + </Icons> + <LaunchConditions/> + <Notifications/> + </UiApp> + </Apps> +</Manifest> + diff --git a/project/res/ara-AE.xml b/project/res/ara-AE.xml new file mode 100644 index 0000000..cb18437 --- /dev/null +++ b/project/res/ara-AE.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<string_table Bversion="1.0.0.v20100531" Dversion="3"> + <text id="IDS_HELLO">مرحبا بالجميع</text> +</string_table> diff --git a/project/res/aze-AZ.xml b/project/res/aze-AZ.xml new file mode 100755 index 0000000..584fa16 --- /dev/null +++ b/project/res/aze-AZ.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<string_table Bversion="2.0.0.v20110523" Dversion="20100701">
+ <text id="IDS_HELLO">Hər kəsə salam</text>
+</string_table>
diff --git a/project/res/bul-BG.xml b/project/res/bul-BG.xml new file mode 100755 index 0000000..6752105 --- /dev/null +++ b/project/res/bul-BG.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Здравейте всички</text>
+</string_table>
diff --git a/project/res/cat-ES.xml b/project/res/cat-ES.xml new file mode 100755 index 0000000..941c293 --- /dev/null +++ b/project/res/cat-ES.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hola a tots</text>
+</string_table>
diff --git a/project/res/ces-CZ.xml b/project/res/ces-CZ.xml new file mode 100755 index 0000000..8949118 --- /dev/null +++ b/project/res/ces-CZ.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Ahoj, všichni</text>
+</string_table>
diff --git a/project/res/dan-DK.xml b/project/res/dan-DK.xml new file mode 100755 index 0000000..4b23010 --- /dev/null +++ b/project/res/dan-DK.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hej alle!</text>
+</string_table>
diff --git a/project/res/deu-DE.xml b/project/res/deu-DE.xml new file mode 100755 index 0000000..d338eae --- /dev/null +++ b/project/res/deu-DE.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hallo zusammen</text>
+</string_table>
diff --git a/project/res/ell-GR.xml b/project/res/ell-GR.xml new file mode 100755 index 0000000..735ed43 --- /dev/null +++ b/project/res/ell-GR.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Γεια σε όλους</text>
+</string_table>
diff --git a/project/res/eng-GB.xml b/project/res/eng-GB.xml new file mode 100755 index 0000000..3b4e79c --- /dev/null +++ b/project/res/eng-GB.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hello, everyone</text>
+</string_table>
diff --git a/project/res/eng-PH.xml b/project/res/eng-PH.xml new file mode 100755 index 0000000..3b4e79c --- /dev/null +++ b/project/res/eng-PH.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hello, everyone</text>
+</string_table>
diff --git a/project/res/eng-US.xml b/project/res/eng-US.xml new file mode 100755 index 0000000..3b4e79c --- /dev/null +++ b/project/res/eng-US.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hello, everyone</text>
+</string_table>
diff --git a/project/res/est-EE.xml b/project/res/est-EE.xml new file mode 100755 index 0000000..026860f --- /dev/null +++ b/project/res/est-EE.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Tere kõigile</text>
+</string_table>
diff --git a/project/res/eus-ES.xml b/project/res/eus-ES.xml new file mode 100755 index 0000000..73b89ae --- /dev/null +++ b/project/res/eus-ES.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Kaixo, guztiei</text>
+</string_table>
diff --git a/project/res/fas-IR.xml b/project/res/fas-IR.xml new file mode 100755 index 0000000..a96c91c --- /dev/null +++ b/project/res/fas-IR.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">سلام به همه</text>
+</string_table>
diff --git a/project/res/fin-FI.xml b/project/res/fin-FI.xml new file mode 100755 index 0000000..641415a --- /dev/null +++ b/project/res/fin-FI.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hei, kaikki</text>
+</string_table>
diff --git a/project/res/fra-CA.xml b/project/res/fra-CA.xml new file mode 100755 index 0000000..1dbb31f --- /dev/null +++ b/project/res/fra-CA.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Bonjour tout le monde</text>
+</string_table>
diff --git a/project/res/fra-FR.xml b/project/res/fra-FR.xml new file mode 100755 index 0000000..1dbb31f --- /dev/null +++ b/project/res/fra-FR.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Bonjour tout le monde</text>
+</string_table>
diff --git a/project/res/gle-IE.xml b/project/res/gle-IE.xml new file mode 100755 index 0000000..f889873 --- /dev/null +++ b/project/res/gle-IE.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Bail ó Dhia oraibh</text>
+</string_table>
diff --git a/project/res/glg-ES.xml b/project/res/glg-ES.xml new file mode 100755 index 0000000..938accc --- /dev/null +++ b/project/res/glg-ES.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Ola a todos</text>
+</string_table>
diff --git a/project/res/heb-IL.xml b/project/res/heb-IL.xml new file mode 100755 index 0000000..d029e54 --- /dev/null +++ b/project/res/heb-IL.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">שלום לכולם</text>
+</string_table>
diff --git a/project/res/hin-IN.xml b/project/res/hin-IN.xml new file mode 100644 index 0000000..bb38e67 --- /dev/null +++ b/project/res/hin-IN.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<string_table Bversion="1.0.0.v20100531" Dversion="3"> + <text id="IDS_HELLO">सबको नमस्ते</text> +</string_table> diff --git a/project/res/hrv-HR.xml b/project/res/hrv-HR.xml new file mode 100755 index 0000000..9074070 --- /dev/null +++ b/project/res/hrv-HR.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Zdravo svima</text>
+</string_table>
diff --git a/project/res/hun-HU.xml b/project/res/hun-HU.xml new file mode 100755 index 0000000..f537c6e --- /dev/null +++ b/project/res/hun-HU.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Üdv mindenki!</text>
+</string_table>
diff --git a/project/res/hye-AM.xml b/project/res/hye-AM.xml new file mode 100755 index 0000000..4ef48c7 --- /dev/null +++ b/project/res/hye-AM.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<string_table Bversion="1.0.0.v20100531" Dversion="3"> + <text id="IDS_HELLO">Բարեւ Ձեզ</text> +</string_table> diff --git a/project/res/ind-ID.xml b/project/res/ind-ID.xml new file mode 100755 index 0000000..a1d09a9 --- /dev/null +++ b/project/res/ind-ID.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Halo, semuanya</text>
+</string_table>
diff --git a/project/res/isl-IS.xml b/project/res/isl-IS.xml new file mode 100755 index 0000000..bcdaa96 --- /dev/null +++ b/project/res/isl-IS.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Halló allir</text>
+</string_table>
diff --git a/project/res/ita-IT.xml b/project/res/ita-IT.xml new file mode 100755 index 0000000..8d7094c --- /dev/null +++ b/project/res/ita-IT.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Ciao a tutti</text>
+</string_table>
diff --git a/project/res/jpn-JA.xml b/project/res/jpn-JA.xml new file mode 100755 index 0000000..c3ad0bd --- /dev/null +++ b/project/res/jpn-JA.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- + This XML file was automatically generated by UiBuilder - do not modify by hand. +--> +<string_table Bversion="2.0.0.v20110523" Dversion="20100701"> + <text id="IDS_HELLO">こんにちは、皆さん。</text> +</string_table>
\ No newline at end of file diff --git a/project/res/kat-GE.xml b/project/res/kat-GE.xml new file mode 100755 index 0000000..2a24400 --- /dev/null +++ b/project/res/kat-GE.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<string_table Bversion="2.0.0.v20110523" Dversion="20100701">
+ <text id="IDS_HELLO">ყველას მოგესალმებით</text>
+</string_table>
diff --git a/project/res/kaz-KZ.xml b/project/res/kaz-KZ.xml new file mode 100755 index 0000000..22e04b2 --- /dev/null +++ b/project/res/kaz-KZ.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Сәлем, барлығына</text>
+</string_table>
diff --git a/project/res/kor-KR.xml b/project/res/kor-KR.xml new file mode 100755 index 0000000..078dac9 --- /dev/null +++ b/project/res/kor-KR.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">안녕하세요, 여러분</text>
+</string_table>
diff --git a/project/res/lav-LV.xml b/project/res/lav-LV.xml new file mode 100755 index 0000000..c267b85 --- /dev/null +++ b/project/res/lav-LV.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Sveicieni visiem!</text>
+</string_table>
diff --git a/project/res/lit-LT.xml b/project/res/lit-LT.xml new file mode 100755 index 0000000..6b51980 --- /dev/null +++ b/project/res/lit-LT.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Sveiki, visi</text>
+</string_table>
diff --git a/project/res/mkd-MK.xml b/project/res/mkd-MK.xml new file mode 100755 index 0000000..0058fa5 --- /dev/null +++ b/project/res/mkd-MK.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Здраво на сите</text>
+</string_table>
diff --git a/project/res/msa-MY.xml b/project/res/msa-MY.xml new file mode 100755 index 0000000..7d4d512 --- /dev/null +++ b/project/res/msa-MY.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Helo, semua</text>
+</string_table>
diff --git a/project/res/nld-NL.xml b/project/res/nld-NL.xml new file mode 100755 index 0000000..dd4052a --- /dev/null +++ b/project/res/nld-NL.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hallo allemaal</text>
+</string_table>
diff --git a/project/res/nob-NO.xml b/project/res/nob-NO.xml new file mode 100644 index 0000000..0e0f1c5 --- /dev/null +++ b/project/res/nob-NO.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<string_table Bversion="1.0.0.v20100531" Dversion="3"> + <text id="IDS_HELLO">Hei, alle sammen</text> +</string_table> diff --git a/project/res/nor-NO.xml b/project/res/nor-NO.xml new file mode 100755 index 0000000..c6eeca4 --- /dev/null +++ b/project/res/nor-NO.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hei alle sammen</text>
+</string_table>
diff --git a/project/res/pol-PL.xml b/project/res/pol-PL.xml new file mode 100755 index 0000000..64b82df --- /dev/null +++ b/project/res/pol-PL.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Cześć wszystkim</text>
+</string_table>
diff --git a/project/res/por-BR.xml b/project/res/por-BR.xml new file mode 100755 index 0000000..993f4fe --- /dev/null +++ b/project/res/por-BR.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Olá a todos</text>
+</string_table>
diff --git a/project/res/por-PT.xml b/project/res/por-PT.xml new file mode 100755 index 0000000..993f4fe --- /dev/null +++ b/project/res/por-PT.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Olá a todos</text>
+</string_table>
diff --git a/project/res/ron-RO.xml b/project/res/ron-RO.xml new file mode 100755 index 0000000..2598ebc --- /dev/null +++ b/project/res/ron-RO.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Bună ziua tuturor</text>
+</string_table>
diff --git a/project/res/rus-RU.xml b/project/res/rus-RU.xml new file mode 100755 index 0000000..8d9d1ad --- /dev/null +++ b/project/res/rus-RU.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Здравствуйте!</text>
+</string_table>
diff --git a/project/res/slk-SK.xml b/project/res/slk-SK.xml new file mode 100755 index 0000000..473f37c --- /dev/null +++ b/project/res/slk-SK.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Zdravíme všetkých</text>
+</string_table>
diff --git a/project/res/slv-SI.xml b/project/res/slv-SI.xml new file mode 100755 index 0000000..44fe301 --- /dev/null +++ b/project/res/slv-SI.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Lep pozdrav vsem</text>
+</string_table>
diff --git a/project/res/spa-ES.xml b/project/res/spa-ES.xml new file mode 100755 index 0000000..1637ae6 --- /dev/null +++ b/project/res/spa-ES.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hola a todos</text>
+</string_table>
diff --git a/project/res/spa-US.xml b/project/res/spa-US.xml new file mode 100755 index 0000000..1637ae6 --- /dev/null +++ b/project/res/spa-US.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hola a todos</text>
+</string_table>
diff --git a/project/res/srp-RS.xml b/project/res/srp-RS.xml new file mode 100755 index 0000000..9074070 --- /dev/null +++ b/project/res/srp-RS.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Zdravo svima</text>
+</string_table>
diff --git a/project/res/swe-SE.xml b/project/res/swe-SE.xml new file mode 100755 index 0000000..016a9a9 --- /dev/null +++ b/project/res/swe-SE.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Hej allihop</text>
+</string_table>
diff --git a/project/res/tha-TH.xml b/project/res/tha-TH.xml new file mode 100755 index 0000000..6cc82ae --- /dev/null +++ b/project/res/tha-TH.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">สวัสดีทุกท่าน</text>
+</string_table>
diff --git a/project/res/tur-TR.xml b/project/res/tur-TR.xml new file mode 100755 index 0000000..e48d583 --- /dev/null +++ b/project/res/tur-TR.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Merhaba herkese</text>
+</string_table>
diff --git a/project/res/ukr-UA.xml b/project/res/ukr-UA.xml new file mode 100755 index 0000000..d6741d4 --- /dev/null +++ b/project/res/ukr-UA.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Привіт усім!</text>
+</string_table>
diff --git a/project/res/urd-PK.xml b/project/res/urd-PK.xml new file mode 100755 index 0000000..27cb522 --- /dev/null +++ b/project/res/urd-PK.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">ہیلو، سب لوگ</text>
+</string_table>
diff --git a/project/res/uzb-UZ.xml b/project/res/uzb-UZ.xml new file mode 100644 index 0000000..a4db771 --- /dev/null +++ b/project/res/uzb-UZ.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<string_table Bversion="1.0.0.v20100531" Dversion="3"> + <text id="IDS_HELLO">Assalomu Alaykum!</text> +</string_table> diff --git a/project/res/vie-VN.xml b/project/res/vie-VN.xml new file mode 100755 index 0000000..26e351b --- /dev/null +++ b/project/res/vie-VN.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">Xin chào mọi người</text>
+</string_table>
diff --git a/project/res/zho-CN.xml b/project/res/zho-CN.xml new file mode 100755 index 0000000..9363000 --- /dev/null +++ b/project/res/zho-CN.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">大家好</text>
+</string_table>
diff --git a/project/res/zho-HK.xml b/project/res/zho-HK.xml new file mode 100755 index 0000000..c62ee51 --- /dev/null +++ b/project/res/zho-HK.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">各位好</text>
+</string_table>
diff --git a/project/res/zho-SG.xml b/project/res/zho-SG.xml new file mode 100755 index 0000000..8ee0826 --- /dev/null +++ b/project/res/zho-SG.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">大家好吗</text>
+</string_table>
diff --git a/project/res/zho-TW.xml b/project/res/zho-TW.xml new file mode 100755 index 0000000..9363000 --- /dev/null +++ b/project/res/zho-TW.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<string_table Bversion="1.0.0.v20100531" Dversion="3">
+ <text id="IDS_HELLO">大家好</text>
+</string_table>
diff --git a/project/shared/data/nofile.dummy b/project/shared/data/nofile.dummy new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/project/shared/data/nofile.dummy diff --git a/project/shared/res/screen-density-xhigh/mainmenu.png b/project/shared/res/screen-density-xhigh/mainmenu.png Binary files differnew file mode 100755 index 0000000..983c883 --- /dev/null +++ b/project/shared/res/screen-density-xhigh/mainmenu.png diff --git a/project/shared/trusted/nofile.dummy b/project/shared/trusted/nofile.dummy new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/project/shared/trusted/nofile.dummy diff --git a/project/src/MainForm.cpp b/project/src/MainForm.cpp new file mode 100644 index 0000000..d65ab00 --- /dev/null +++ b/project/src/MainForm.cpp @@ -0,0 +1,172 @@ +// +// Tizen Native SDK +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.tizenopensource.org/license +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include <new> + +#include <FApp.h> +#include <FGraphics.h> +#include <FSystem.h> + +#include "MainForm.h" + +using namespace Tizen::Base; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; +using namespace Tizen::Graphics; +using namespace Tizen::System; +using namespace Tizen::App; + +const int MAX_LABEL_TEXT = 35; +const int LANGUAGE_LABEL_HEIGHT = 50; +const int VALUE_LABEL_HEIGHT = 80; +const int VALUE_LABEL_Y = 120; +const int SETTING_LABEL_HEIGHT = 200; +const int HELLO_LABEL_Y = 430; +const int MAX_HELLO_TEXT = 40; + +unsigned int ORANGE_COLOR = 0xffa500; + + +MainForm::MainForm(void) + : __pValueLabel(null) + , __pHelloLabel(null) +{ +} + +MainForm::~MainForm(void) +{ +} + +bool +MainForm::Initialize(void) +{ + Construct(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER); + return true; +} + +result +MainForm::OnInitializing(void) +{ + result r = E_SUCCESS; + + Header* pHeader = Form::GetHeader(); + pHeader->SetTitleText(L"Multiple Language"); + + int index = 0; + String localelanguageCode; + String languageCode; + String countryCode; + String currentSetting; + + r = SettingInfo::GetValue(L"http://tizen.org/setting/locale.language", localelanguageCode); + TryLog(!IsFailed(r), "[%s] Cannot get the current language setting", GetErrorMessage(r)); + + localelanguageCode.IndexOf("-",0,index); + localelanguageCode.SubString(0,index,languageCode); + localelanguageCode.SubString(index+1, localelanguageCode.GetLength()- index -1,countryCode); + languageCode.Append(L"-"); + languageCode.Append(countryCode); + + currentSetting = languageCode; + + // Create a Label + Label* pLabel = new (std::nothrow) Label(); + TryReturn(pLabel != null, E_OUT_OF_MEMORY, "Label creation failed."); + + Rectangle clientArea = GetClientAreaBounds(); + pLabel->Construct(Rectangle(0, LANGUAGE_LABEL_HEIGHT, clientArea.width, LANGUAGE_LABEL_HEIGHT), L"Current language setting:"); + pLabel->SetTextConfig(MAX_LABEL_TEXT,LABEL_TEXT_STYLE_NORMAL); + pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT); + + AddControl(*pLabel); + + // Create a Label + __pValueLabel = new (std::nothrow) Label(); + TryReturn(__pValueLabel != null, E_OUT_OF_MEMORY, "Label creation failed."); + + __pValueLabel->Construct(Rectangle(0, VALUE_LABEL_Y, clientArea.width, VALUE_LABEL_HEIGHT), currentSetting); + __pValueLabel->SetTextConfig(LANGUAGE_LABEL_HEIGHT, LABEL_TEXT_STYLE_BOLD); + __pValueLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER); + __pValueLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE); + + AddControl(*__pValueLabel); + + // Create a Label + pLabel = new (std::nothrow) Label(); + TryReturn(pLabel != null, E_OUT_OF_MEMORY, "Label creation failed."); + + pLabel->Construct(Rectangle(0, SETTING_LABEL_HEIGHT, clientArea.width, SETTING_LABEL_HEIGHT), + L"If the language setting of this device is changed, following message is also changed."); + pLabel->SetTextConfig(MAX_LABEL_TEXT, LABEL_TEXT_STYLE_NORMAL); + pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT); + + AddControl(*pLabel); + + + // Show Hello + String getHello; + Application::GetInstance()->GetAppResource()->GetString(L"IDS_HELLO", getHello); + __pHelloLabel = new (std::nothrow) Label(); + TryReturn(__pHelloLabel != null, E_OUT_OF_MEMORY, "Label creation failed."); + + __pHelloLabel->Construct(Rectangle(0, HELLO_LABEL_Y, clientArea.width, VALUE_LABEL_Y), getHello); + __pHelloLabel->SetTextConfig(MAX_HELLO_TEXT, LABEL_TEXT_STYLE_NORMAL); + + __pHelloLabel->SetBackgroundColor(Color(ORANGE_COLOR, false)); + __pHelloLabel->SetTextColor(Color::GetColor(COLOR_ID_BLACK)); + __pHelloLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER); + __pHelloLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE); + + AddControl(*__pHelloLabel); + + return r; +} + +result +MainForm::OnTerminating(void) +{ + result r = E_SUCCESS; + + return r; +} + +result +MainForm::OnDraw() +{ + int index = 0; + String localelanguageCode; + String languageCode; + String countryCode; + + result r = SettingInfo::GetValue(L"http://tizen.org/setting/locale.language", localelanguageCode); + TryLog(!IsFailed(r), "[%s] Cannot get the current language setting", GetErrorMessage(r)); + + localelanguageCode.IndexOf("_",0,index); + localelanguageCode.SubString(0,index,languageCode); + localelanguageCode.SubString(index+1, localelanguageCode.GetLength()- index -1,countryCode); + languageCode.Append(L"-"); + languageCode.Append(countryCode); + + __pValueLabel->SetText(languageCode); + String getHello; + Application::GetInstance()->GetAppResource()->GetString(L"IDS_HELLO", getHello); + __pHelloLabel->SetText(getHello); + + return E_SUCCESS; +} + + diff --git a/project/src/MultiLanguage.cpp b/project/src/MultiLanguage.cpp new file mode 100644 index 0000000..0f9da8c --- /dev/null +++ b/project/src/MultiLanguage.cpp @@ -0,0 +1,121 @@ +// +// Tizen Native SDK +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.tizenopensource.org/license +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include <new> + +#include "MainForm.h" +#include "MultiLanguage.h" + +using namespace Tizen::Base; +using namespace Tizen::System; +using namespace Tizen::App; +using namespace Tizen::Ui::Controls; + + +MultiLanguage::MultiLanguage(void) + : __pMainForm(null) +{ +} + + +MultiLanguage::~MultiLanguage(void) +{ +} + + +Application* +MultiLanguage::CreateInstance(void) +{ + return new (std::nothrow) MultiLanguage(); +} + + +bool +MultiLanguage::OnAppInitializing(AppRegistry& appRegistry) +{ + + SettingInfo::AddSettingEventListener(*this); + + Frame* pAppFrame = new (std::nothrow) Frame(); + TryReturn(pAppFrame != null, false, "Frame creation failed."); + + pAppFrame->Construct(); + AddFrame(*pAppFrame); + + __pMainForm = new MainForm(); + TryReturn(__pMainForm != null, false, "Form creation failed."); + + __pMainForm->Initialize(); + pAppFrame->AddControl(*__pMainForm); + pAppFrame->SetCurrentForm(*__pMainForm); + + return true; +} + + +bool +MultiLanguage::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination) +{ + SettingInfo::RemoveSettingEventListener(*this); + + return true; +} + + +void +MultiLanguage::OnForeground(void) +{ +} + + +void +MultiLanguage::OnBackground(void) +{ +} + + +void +MultiLanguage::OnLowMemory(void) +{ +} + + +void +MultiLanguage::OnBatteryLevelChanged(BatteryLevel batteryLevel) +{ +} + +void +MultiLanguage::OnScreenOn (void) +{ +} + +void +MultiLanguage::OnScreenOff (void) +{ +} + +void +MultiLanguage::OnSettingChanged(Tizen::Base::String& key) +{ + if (key == L"http://tizen.org/setting/locale.language") + { + __pMainForm->Invalidate(true); + } +} + + diff --git a/project/src/MultiLanguageEntry.cpp b/project/src/MultiLanguageEntry.cpp new file mode 100644 index 0000000..6f61d5a --- /dev/null +++ b/project/src/MultiLanguageEntry.cpp @@ -0,0 +1,60 @@ +// +// Tizen Native SDK +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.tizenopensource.org/license +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * This file contains the Tizen Native application entry point. + */ +#include <new> +#include "MultiLanguage.h" + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +_EXPORT_ int OspMain(int argc, char *pArgv[]); + +/** + * The entry function of Tizen Native application called by the operating system. + */ +int +OspMain(int argc, char *pArgv[]) +{ + result r = E_SUCCESS; + + AppLog("Application started."); + ArrayList args; + args.Construct(); + for (int i = 0; i < argc; i++) + { + args.Add(*(new (std::nothrow) String(pArgv[i]))); + } + + r = Tizen::App::UiApp::Execute(MultiLanguage::CreateInstance, &args); + TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r)); + + args.RemoveAll(true); + AppLog("Application finished."); + + return static_cast<int>(r); +} +#ifdef __cplusplus +} +#endif // __cplusplus diff --git a/sample.xml b/sample.xml new file mode 100755 index 0000000..66b852f --- /dev/null +++ b/sample.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<template> + + <slp-property> + <property-group> + <sample-name>MultiLanguage</sample-name> + <category>Sample</category> + <sdk-version>1.00</sdk-version> + <project-type>org.tizen.nativecpp.buildArtefactType.app</project-type> + <sample-description>description.xml</sample-description> + </property-group> + </slp-property> + + <process type="org.tizen.nativeappcommon.TizenCopyFolder"> + <simple name="projectName" value="$(projectName)"/> + <simple name="folderPath" value="project"/> + <complex-array name="replaceableFiles"> + <element> + <simple name="sourcePath" value="manifest.xml"/> + <simple name="targetPath" value="manifest.xml"/> + <simple name="replaceable" value = "true"/> + </element> + </complex-array> + </process> + <process type="org.tizen.nativecpp.SetDefaultFrameworks"> + <simple name="projectName" value="$(projectName)"/> + <complex-array name="frameworkList"> + <element> + <simple name="framework" value="osp"/> + </element> + </complex-array> + </process> + +</template> diff --git a/screenshot.png b/screenshot.png Binary files differnew file mode 100644 index 0000000..01fe28b --- /dev/null +++ b/screenshot.png |