Class: Wx::Locale

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/classes/locale.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get_system_encoding_nameObject



7
8
9
# File 'lib/wx/classes/locale.rb', line 7

def get_system_encoding_name
  Wx::Font::ENCODING_NAMES[ get_system_encoding ]
end

.get_system_language_nameObject



3
4
5
# File 'lib/wx/classes/locale.rb', line 3

def get_system_language_name
  get_language_name( get_system_language )
end

.set_locale(locale) ⇒ Object

Set the current locale by a name, canonical name, or Wx::LANGUAGE_ constant; mainly here because it seems a bit strange in Ruby to have global side-effects in a constructor



14
15
16
17
18
19
20
21
22
# File 'lib/wx/classes/locale.rb', line 14

def set_locale(locale)
  if locale.kind_of?(Fixnum)
    new(locale)
  elsif locale.kind_of?(String) and lang_info = find_language_info(locale)
    new(lang_info.language)
  else
    raise ArgumentError, "Unknown language #{locale}"
  end
end

Instance Method Details

#get_language_nameObject



25
26
27
# File 'lib/wx/classes/locale.rb', line 25

def get_language_name
  self.class.get_language_name(get_language)
end