Class: LanguageHandler
- Inherits:
-
Object
- Object
- LanguageHandler
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:
Instance Method Summary # collapse
-
#[](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.
-
#initialize(filename) ⇒ LanguageHandler
constructor
The new method is used to create a new LanguageHandler object.
-
#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
↑ #initialize(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.