Class: GetText::LocalePath

Class | GetText::LocalePath
In: | lib/gettext/locale_path.rb
Parent: | Object

Treats locale-path for mo-files.

### Methods

add_default_rule current_path default_path_rules new

### Included Modules

Locale::Util::Memoizable Locale::Util::Memoizable

### Constants

CONFIG_PREFIX | = | Config::CONFIG['prefix'].gsub(/\/local/, "") |  | The default locale paths.
DEFAULT_RULES | = | [ "./locale/%{lang}/LC_MESSAGES/%{name}.mo", "./locale/%{lang}/%{name}.mo", "#{Config::CONFIG['datadir']}/locale/%{lang}/LC_MESSAGES/%{name}.mo", "#{Config::CONFIG['datadir'].gsub(/\/local/, "")}/locale/%{lang}/LC_MESSAGES/%{name}.mo", "#{CONFIG_PREFIX}/share/locale/%{lang}/LC_MESSAGES/%{name}.mo", "#{CONFIG_PREFIX}/local/share/locale/%{lang}/LC_MESSAGES/%{name}.mo"

### Attributes

locale_paths | [R] |
supported_locales | [R] |

### Public Class methods

add_default_rule(path)

Add default locale path. Usually you should use GetText.add_default_locale_path instead.

- path: a new locale path. (e.g.) "/usr/share/locale/%{lang}/LC_MESSAGES/%{name}.mo" (‘locale’ => "ja_JP", ‘name’ => "textdomain")
- Returns: the new DEFAULT_LOCALE_PATHS

default_path_rules()

Returns path rules as an Array. (e.g.) ["/usr/share/locale/%{lang}/LC_MESSAGES/%{name}.mo", …]

new(name, topdir = nil)

Creates a new GetText::TextDomain.

- name: the textdomain name.
- topdir: the locale path ("%{topdir}/%{lang}/LC_MESSAGES/%{name}.mo") or nil.

### Public Instance methods

current_path(lang)

Gets the current path.

- lang: a Locale::Tag.

[Validate]