Class: LanguageHandler
Relationships | |
Inherits: | Object |
Overview
The LanguageHandler class contains methods used to help make SketchUp extensions easier to localize across different languages. It looks for translated resources within the Resources folder in the extension’s directory structure. All translated resources should be located within the appropriate language folder and encoded in UTF-8. The strings file should include “key”=“value” string pairs in the following format:
language code gocorp_swiveldriver/Resources/fr/swiveldriver.strings
gocorp_swiveldriver/Resources/es/swiveldriver.strings
Class Method Summary
-
.new(filename) ⇒ LanguageHandler
constructor
The new method is used to create a new
LanguageHandler
object.
Instance Method Summary
-
#[](key) ⇒ String
Looks up and returns the localized version of a given string, based on the language SketchUp is currently running in, and the available translations in the Resources folder.
-
#resource_path ⇒ String
Returns a string containing the path to the given filename if it can be found in the Resources folder.
-
#strings ⇒ Hash
Returns a Hash object containing the localization dictionary.
Constructor Details
.new(filename) ⇒ LanguageHandler
The new method is used to create a new LanguageHandler
object.
Instance Method Details
#[](key) ⇒ String
Looks up and returns the localized version of a given string, based on the language SketchUp is currently running in, and the available translations in the Resources folder.
#resource_path ⇒ String
Returns a string containing the path to the given filename if it can be found in the Resources folder.
#strings ⇒ Hash
Returns a Hash object containing the localization dictionary.