From fe27e98227f13438a51b92860ceadcf0c1fa50e9 Mon Sep 17 00:00:00 2001 From: Beata Stefaniuk Date: Mon, 10 Aug 2015 13:06:25 +0200 Subject: [PATCH] [Tutorial][Base-Utils] Timezone tutorial update (sync with 2.3.1) Sync Timezone tutorial with 2.3.1 Typo fixes Change-Id: Icce33469cae94b61b5d36bf75328a91cb4347625 Signed-off-by: Beata Stefaniuk Signed-off-by: Jakub Siewierski --- .../html/native/base/i18n_tutorial_n.htm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/org.tizen.tutorials/html/native/base/i18n_tutorial_n.htm b/org.tizen.tutorials/html/native/base/i18n_tutorial_n.htm index 50a8f49..64b5df4 100644 --- a/org.tizen.tutorials/html/native/base/i18n_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/base/i18n_tutorial_n.htm @@ -289,7 +289,7 @@ i18n_usearch_h usearch; i18n_usearch_create_new(pattern, -1, text, -1, I18N_ULOCALE_US, NULL, &usearch);
  • Get the index of the first match. -

    To get the index of the first occurence of the found pattern, use the i18n_usearch_first() function.

    +

    To get the index of the first occurrence of the found pattern, use the i18n_usearch_first() function.

     int index;
     i18n_usearch_first(usearch, &index);
    @@ -665,7 +665,7 @@ const char * locale = i18n_unumber_get_locale_by_type(num_format, I18N_ULOCALE_D
     
    i18n_unumber_destroy(num_format);
  • -

    Managing Iteration Using Ubreak

    +

    Managing Iteration Using Ubrk

    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:

      @@ -675,7 +675,7 @@ const char * locale = i18n_unumber_get_locale_by_type(num_format, I18N_ULOCALE_D
    1. Create a boundary to iterate through a string by words.

      -

      To start using the Ubreak library, create an iterator using the i18n_ubrk_create() function. Specify its parameters, which are the type of the iterator (use the I18N_UBRK_WORD word, I18N_UBRK_CHARACTER character, I18N_UBRK_LINE line, or I18N_UBRK_SENTENCE sentence iteration), the locale, string to iterate through, length of the string, and a handle to the created iterator.

      +

      To start using the Ubrk library, create an iterator using the i18n_ubrk_create() function. Specify its parameters, which are the type of the iterator (use the I18N_UBRK_WORD word, I18N_UBRK_CHARACTER character, I18N_UBRK_LINE line, or I18N_UBRK_SENTENCE sentence iteration), the locale, string to iterate through, length of the string, and a handle to the created iterator.

       i18n_ubreak_iterator_h boundary;
       const char *str = "Twinkle, twinkle little star"
      @@ -858,7 +858,7 @@ i18n_uenumeration_destroy(keywords);
       
       
    2. Retrieve timezone information: -
      • To get the default timezone based on the time zone where the program is running:

        +
        • To get the default timezone based on the timezone where the program is running:

           i18n_timezone_h tmz;
           i18n_timezone_create_default(&tmz);
          @@ -886,16 +886,19 @@ i18n_timezone_get_dst_savings(tmz, &dst_savings);
           
        • To get the daylight savings (the amount of time to be added to the local standard time to get the local wall clock time):

          +#define MS_TO_MIN 60000
           int32_t dst_savings;
          -i18n_timezone_get_dst_savings(tmz, &dst_savings);
          +i18n_timezone_get_dst_savings(tmz, &dst_savings/MS_TO_MIN);
           
          -

          The result is returned in milliseconds (3600000 ms = 1 hour).

        • +

          The result is returned in milliseconds (3600000 ms = 1 hour). In this tutorial milliseconds are changed to minutes (1 min = 60000 ms).

        • +
        • To get the raw GMT offset:

          +#define MS_TO_MIN 60000
           int32_t offset_milliseconds;
          -i18n_timezone_get_raw_offset(tmz, &offset_milliseconds);
          +i18n_timezone_get_raw_offset(tmz, &offset_milliseconds/MS_TO_MIN);
           
          -

          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.

        • +

          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).

        • To get the region code associated with the timezone ID:

          -- 
          2.7.4