[Tutorial][Base-Utils] Timezone tutorial update (sync with 2.3.1)
authorBeata Stefaniuk <b.stefaniuk@samsung.com>
Mon, 10 Aug 2015 11:06:25 +0000 (13:06 +0200)
committerJakub Siewierski <j.siewierski@samsung.com>
Thu, 13 Aug 2015 10:22:52 +0000 (12:22 +0200)
Sync Timezone tutorial with 2.3.1
Typo fixes

Change-Id: Icce33469cae94b61b5d36bf75328a91cb4347625
Signed-off-by: Beata Stefaniuk <b.stefaniuk@samsung.com>
Signed-off-by: Jakub Siewierski <j.siewierski@samsung.com>
org.tizen.tutorials/html/native/base/i18n_tutorial_n.htm

index 50a8f49..64b5df4 100644 (file)
@@ -289,7 +289,7 @@ i18n_usearch_h usearch;
 i18n_usearch_create_new(pattern, -1, text, -1, I18N_ULOCALE_US, NULL, &amp;usearch);
 </pre></li>
 <li>Get the index of the first match.
-<p>To get the index of the first occurence of the found pattern, use the <span style="font-family: Courier New,Courier,monospace">i18n_usearch_first()</span> function.</p>
+<p>To get the index of the first occurrence of the found pattern, use the <span style="font-family: Courier New,Courier,monospace">i18n_usearch_first()</span> function.</p>
 <pre class="prettyprint">
 int index;
 i18n_usearch_first(usearch, &amp;index);
@@ -665,7 +665,7 @@ const char * locale = i18n_unumber_get_locale_by_type(num_format, I18N_ULOCALE_D
 <pre class="prettyprint">i18n_unumber_destroy(num_format);</pre></li>
 </ol>
 
-<h2 id="ubrk" name="ubrk">Managing Iteration Using Ubreak</h2>
+<h2 id="ubrk" name="ubrk">Managing Iteration Using Ubrk</h2>
 
 <p>To manipulate or iterate through strings you can use the Ubrk library. It helps you to treat strings as a set of characters, words or sentences:</p>
 <ol>
@@ -675,7 +675,7 @@ const char * locale = i18n_unumber_get_locale_by_type(num_format, I18N_ULOCALE_D
 </pre></li>
 
 <li><p>Create a boundary to iterate through a string by words.</p>
-<p>To start using the Ubreak library, create an iterator using the <span style="font-family: Courier New,Courier,monospace">i18n_ubrk_create()</span> function. Specify its parameters, which are the type of the iterator (use the <span style="font-family: Courier New,Courier,monospace">I18N_UBRK_WORD</span> word, <span style="font-family: Courier New,Courier,monospace">I18N_UBRK_CHARACTER</span> character, <span style="font-family: Courier New,Courier,monospace">I18N_UBRK_LINE</span> line, or <span style="font-family: Courier New,Courier,monospace">I18N_UBRK_SENTENCE</span> sentence iteration), the locale, string to iterate through, length of the string, and a handle to the created iterator.</p>
+<p>To start using the Ubrk library, create an iterator using the <span style="font-family: Courier New,Courier,monospace">i18n_ubrk_create()</span> function. Specify its parameters, which are the type of the iterator (use the <span style="font-family: Courier New,Courier,monospace">I18N_UBRK_WORD</span> word, <span style="font-family: Courier New,Courier,monospace">I18N_UBRK_CHARACTER</span> character, <span style="font-family: Courier New,Courier,monospace">I18N_UBRK_LINE</span> line, or <span style="font-family: Courier New,Courier,monospace">I18N_UBRK_SENTENCE</span> sentence iteration), the locale, string to iterate through, length of the string, and a handle to the created iterator.</p>
 <pre class="prettyprint">
 i18n_ubreak_iterator_h boundary;
 const char *str = &quot;Twinkle, twinkle little star&quot;
@@ -858,7 +858,7 @@ i18n_uenumeration_destroy(keywords);
 
 <li>Retrieve timezone information:
 
-<ul><li><p>To get the default timezone based on the time zone where the program is running:</p>
+<ul><li><p>To get the default timezone based on the timezone where the program is running:</p>
 <pre class="prettyprint">
 i18n_timezone_h tmz;
 i18n_timezone_create_default(&amp;tmz);
@@ -886,16 +886,19 @@ i18n_timezone_get_dst_savings(tmz, &amp;dst_savings);
 <li>
 <p>To get the daylight savings (the amount of time to be added to the local standard time to get the local wall clock time):</p>
 <pre class="prettyprint">
+#define MS_TO_MIN 60000
 int32_t dst_savings;
-i18n_timezone_get_dst_savings(tmz, &amp;dst_savings);
+i18n_timezone_get_dst_savings(tmz, &amp;dst_savings/MS_TO_MIN);
 </pre>
-<p>The result is returned in milliseconds (3600000 ms = 1 hour).</p></li>
+<p>The result is returned in milliseconds (3600000 ms = 1 hour). In this tutorial milliseconds are changed to minutes (1 min = 60000 ms).</p></li>
+
 <li><p>To get the raw GMT offset:</p>
 <pre class="prettyprint">
+#define MS_TO_MIN 60000
 int32_t offset_milliseconds;
-i18n_timezone_get_raw_offset(tmz, &amp;offset_milliseconds);
+i18n_timezone_get_raw_offset(tmz, &amp;offset_milliseconds/MS_TO_MIN);
 </pre>
-<p>The result is returned in milliseconds. It is the number of milliseconds to add to GMT to get the local time, before taking DST into account.</p></li>
+<p>The result is returned in milliseconds. It is the number of milliseconds to add to GMT to get the local time, before taking DST into account. In this tutorial milliseconds are changed to minutes (1 min = 60000 ms).</p></li>
 
 <li><p>To get the region code associated with the timezone ID:</p>
 <pre class="prettyprint">