Hello IPS experts.
I have questions about IPS, but first let me explain why I am asking those questions.

I am working on proposal of a new interface which provides information about G11n (Globalization) elements, e.g. languages and locales. Including information about packaging of those elements, in order to be able to install/remove them in OpenSolaris.

Consumer of the interface is for example Package manager. It will get list of available languages/locales from the interface. Later on, when user decides to install additional languages, the interface will provide IPS filter (or list of packages) which installs selected languages and locales on the system. Here is example of a filter, which installs localization for French Canadian locale (fr_CA):

  language=fr
  territory=CA
  encoding=UTF-8 | encoding=ISO8859-1 | encoding=ISO8859-15
  message=true

Implementation of the interface will define/store G11n-related data at IPS as attributes and tags. The interface will be querying that data from IPS image and network repository.
Here is example of data I plan to store at IPS (SUNWlang-fr package):

  Package attributes:
    set name=language value=fr
    set name=encoding value=UTF-8
    depend fmri=pkg:/SUNWlang-common type=require

  File tags (ULL=usr/lib/locale):
    PATH                        LANGUAGE TERRITORY ENCODING MESSAGE
    $ULL/fr.UTF-8/LC_MESSAGES         fr             UTF-8   true
    $ULL/fr.UTF-8/LC_MESSAGES/*.mo    fr             UTF-8   true
    $ULL/fr_FR.UTF-8/fr_FR.UTF-8.so.3 fr    FR       UTF-8
    $ULL/fr_CA.UTF-8/fr_CA.UTF-8.so.3 fr    CA       UTF-8

See more details and examples in attached document.


Now my questions come. Can you please do me a favor and help me answer them?

1) Does IPS currently (or will in 2008.11) support custom tags, attributes, and filters from examples described above? Also, will interface consumers be able to use IPS filters for packages/files installation and removal?

2) Is there (Python) IPS interface, which I can call to retrieve the custom package attributes and file tags?

3) Where can I define and modify custom attributes & tags for our (G11n) packages, which were delivered to pkg.opensolaris.org and LiveCD?


I also welcome any comments on design of the proposed interface. You may see a way how to make it simpler, more efficient, etc. For example, I am not sure if using Image and Repository Python objects as input, and Filter object as output of the interface is the best thing to do.

Thank you,
Jan

1.) Introduction
----------------

This document describes a new G11nInstall (G11n = Globalization) interface,
which I plan to integrate into OpenSolaris. The interface provides information
about G11n elements (languages, locales, etc.), and about their packaging. In
order to be able to install/remove G11n elements.

The interface can be for example consumed by:
  - language selection on LiveCD start-up,
  - system default locale selection screen of installer,
  - languages installation screen which may appear in future installer,
  - IPS package manager.

G11n-related data will be stored at IPS as tags, attributes, and dependencies
of packages and files. The interface will be querying that data from IPS image
and network repository.
See also high-level schema (high-level.png).
See examples of G11n-related data and filter at sections 5.) and 6.).

Python will be used for implementation of G11n interface, since it will be
quite often calling IPS interfaces, which are written in Python.


2.) Definition of G11n elements and their relationship
------------------------------------------------------

    language  - usually two letter code, e.g. French = 'fr', Japanese = 'ja'
    territory - usually two capital letter code, e.g. Canada = 'CA'
    codeset   - e.g. 'UTF-8', 'ISO-8859-1', 'PCK'
    variant   - used only when introducing specifically customized locale

    locale =  [EMAIL PROTECTED] 
    e.g. 'fr_CA', 'ja_JP.UTF-8', '[EMAIL PROTECTED]'


3.) Functionality of G11nInstall interface
------------------------------------------

  1. Basic functionality:
    - Get a list of languages and locales installed on the system (IPS image).
    - Get a list of languages and locales available at IPS network repository.
    - Get a list of packages/files which must be installed (removed) on the
      system in order to support given language(s) or locale(s).
    - Get and Set system default locale.

  2. Additional functionality:
    - Provide localized names of languages and territories (displayed e.g. by
      localized versions of installer).
    - Differentiate language/locale enablers (I18n) and software messages
      (L10n), when listing packages/files. As a result the sw messages can be
      installed (removed) separately.
    - List G11n packages/files only if base products/packages are installed on
      the system (formerly SUNW_PKGLIST).
    - Provide info about translation state of languages (locales), e.g.
      fully/partially/not translated.
    - Suggest one sample locale per language (used e.g. for LiveCD session).


4.) Specification of G11nInstall interface
------------------------------------------

  class G11nStorage(object):
    def __init__(self, ips_image):
    def __init__(self, ips_network_repository):
  
    def get_langs(self):
      """Returns list of language objects available at IPS image/repo."""
 
    def get_sysdefault_locale(self):
      """Get system default locale. Returns locale object."""
    def set_sysdefault_locale(self, locale_obj):
      """Set system default locale."""

  class Language(object):
    def __init__(self, langcode_str):
      self.code= langcode_str    # e.g. "fr", "de"

    def get_locales(self):
      """Returns lists of locale objects available for this language."""
    def get_filter(self):
      """Returns IPS filter which installs (removes) this language."""
    def get_packages(self):
      """Returns list of packages which must be installed (removed) to 
      support this language."""

    def get_description(self):
      """Returns language description string, e.g. "french", "german"."""
    def get_l10n_description(self, language):
      """Returns localized language description string, e.g. "francais", 
"allemand"."""
    def get_t18nprogress(self):
      """Returns translation progress of this language as a float number,
      e.g. 0.8 = 80%."""
    def suggest_locale(self):
      """Suggests one sample locale for this language. Returns locale
      object."""

  class Locale(object):
    def __init__(self, language, territory, codeset_str="", variant_str=""):
      self.language=  language
      self.territory= territory
      self.codeset=   codeset_str    # e.g. "UTF-8", "ISO8859-1"
      self.variant=   variant_str    # e.g. "@euro"

    def get_filter(self):
      """Returns IPS filter which installs (removes) this locale."""
    def get_packages(self):
      """Returns list of packages which must be installed (removed) to 
      support this locale."""

    def get_code(self):
      """Returns locale code, e.g. "fr_CA", "de_AT.UTF-8", "[EMAIL 
PROTECTED]"."""

  class Territory(object):
    def __init__(self, terrcode_str):
      self.code= terrcode_str   # e.g. "AT", "CA"

    def get_description(self):
      """Returns territory description string, e.g. "Austria", "Canada"."""
    def get_l10n_description(self, language):
      """Returns localized territory description string, e.g. "Osterreich"."""


5.) Example of G11n-related data stored at IPS
----------------------------------------------

a) Localization files packaged within base package - e.g. SUNWa2ps:

Attributes:
  set name=authority value=opensolaris.org
  set name=description value=...

Tags (file granularity):
NAME  PATH                                    LANGUAGE TERRITORY ENCODING 
MESSAGE
dir   usr/bin
file  usr/bin/a2ps
file  usr/share/locale/fr/LC_MESSAGES/a2ps.mo fr                          true
file  usr/share/locale/de/LC_MESSAGES/a2ps.mo de                          true
file  usr/share/locale/es/LC_MESSAGES/a2ps.mo es                          true
...


b) Localization files packaged separately in dedicated package,
   e.g. Japanese message files for Firefox - SUNWfirefoxl10n-ja-JP:

Attributes:
  set name=language  value=ja
  depend fmri=pkg:/SUNWfirefox      type=exclude
  depend fmri=pkg:/SUNWfirefox-root type=exclude

Tags (file granularity):
NAME  PATH                               LANGUAGE TERRITORY ENCODING MESSAGE
dir   usr/lib/firefox/chrome             ja                          true
file  usr/lib/firefox/chrome/ja.jar      ja                          true
file  usr/lib/firefox/chrome/ja.manifest ja                          true
...


c) Locale enablers and localization file packaged together,
   e.g. French system locales and message files - SUNWlang-fr:

Attributes:
  set name=language value=fr
  set name=encoding value=UTF-8
  depend fmri=pkg:/SUNWlang-common type=require

Tags (file granularity):
NAME  PATH                                        LANGUAGE TERRITORY ENCODING 
MESSAGE
dir   usr/lib/locale/fr.UTF-8                     fr                 UTF-8
dir   usr/lib/locale/fr.UTF-8/LC_MESSAGES         fr                 UTF-8    
true
file  usr/lib/locale/fr.UTF-8/LC_MESSAGES/*.mo    fr                 UTF-8    
true
dir   usr/lib/locale/fr_FR.UTF-8                  fr       FR        UTF-8
file  usr/lib/locale/fr_FR.UTF-8/fr_FR.UTF-8.so.3 fr       FR        UTF-8
dir   usr/lib/locale/fr_CA.UTF-8                  fr       CA        UTF-8
file  usr/lib/locale/fr_CA.UTF-8/fr_CA.UTF-8.so.3 fr       CA        UTF-8
...


6.) Example of G11n-related filter
----------------------------------

  arch=i386
  language=fr
  territory=CA
  encoding=UTF-8 | encoding=ISO8859-1 | encoding=ISO8859-15
  message=true
  documentation=false

<<inline: high-level.png>>

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to