Module: Tolk::Config
- Defined in:
- lib/tolk/config.rb
Class Attribute Summary collapse
-
.base_controller ⇒ Object
specify controller to inherit from to keep Tolk controllers in the same context than the rest of your app.
-
.block_xxx_en_yml_locale_files ⇒ Object
reject files of type xxx.en.yml when syncing locales.
-
.dump_path ⇒ Object
Dump locale path by default the locales folder (config/locales).
-
.exclude_gems_token ⇒ Object
exclude locales tokens from gems.
-
.ignore_keys ⇒ Object
Ignore specific keys.
-
.ignore_locale_files ⇒ Object
specify an array of files to skip [“devise”] will skip devise.<locale>.yml when syncing locales.
-
.mapping ⇒ Object
Mapping : a hash of the type { ‘ar’ => ‘Arabic’ }.
-
.primary_locale_name ⇒ Object
primary locale to not be overriden by default locale in development mode.
-
.strip_texts ⇒ Object
strip translation texts automatically.
-
.yaml_line_width ⇒ Object
specify line width which Yaml.dump will use to break lines.
Class Method Summary collapse
Class Attribute Details
.base_controller ⇒ Object
specify controller to inherit from to keep Tolk controllers in the same context than the rest of your app
34 35 36 |
# File 'lib/tolk/config.rb', line 34 def base_controller @base_controller end |
.block_xxx_en_yml_locale_files ⇒ Object
reject files of type xxx.en.yml when syncing locales
21 22 23 |
# File 'lib/tolk/config.rb', line 21 def block_xxx_en_yml_locale_files @block_xxx_en_yml_locale_files end |
.dump_path ⇒ Object
Dump locale path by default the locales folder (config/locales)
12 13 14 |
# File 'lib/tolk/config.rb', line 12 def dump_path @dump_path end |
.exclude_gems_token ⇒ Object
exclude locales tokens from gems
18 19 20 |
# File 'lib/tolk/config.rb', line 18 def exclude_gems_token @exclude_gems_token end |
.ignore_keys ⇒ Object
Ignore specific keys
37 38 39 |
# File 'lib/tolk/config.rb', line 37 def ignore_keys @ignore_keys end |
.ignore_locale_files ⇒ Object
specify an array of files to skip [“devise”] will skip devise.<locale>.yml when syncing locales.
24 25 26 |
# File 'lib/tolk/config.rb', line 24 def ignore_locale_files @ignore_locale_files end |
.mapping ⇒ Object
Mapping : a hash of the type { ‘ar’ => ‘Arabic’ }
9 10 11 |
# File 'lib/tolk/config.rb', line 9 def mapping @mapping end |
.primary_locale_name ⇒ Object
primary locale to not be overriden by default locale in development mode
15 16 17 |
# File 'lib/tolk/config.rb', line 15 def primary_locale_name @primary_locale_name end |
.strip_texts ⇒ Object
strip translation texts automatically
27 28 29 |
# File 'lib/tolk/config.rb', line 27 def strip_texts @strip_texts end |
.yaml_line_width ⇒ Object
specify line width which Yaml.dump will use to break lines. -1 for not breaking
30 31 32 |
# File 'lib/tolk/config.rb', line 30 def yaml_line_width @yaml_line_width end |
Class Method Details
.reset ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/tolk/config.rb', line 39 def reset @exclude_gems_token = false @strip_texts = true @block_xxx_en_yml_locale_files = true # keep compat with older versions @dump_path = Proc.new { "#{Rails.application.root}/config/locales" } @mapping = { 'ar' => 'Arabic', 'bs' => 'Bosnian', 'bg' => 'Bulgarian', 'ca' => 'Catalan', 'cs' => 'Czech', 'da' => 'Danish', 'de' => 'German', 'el' => 'Greek', 'en' => 'English', 'es' => 'Spanish', 'et' => 'Estonian', 'fa' => 'Persian', 'fi' => 'Finnish', 'fr' => 'French', 'he' => 'Hebrew', 'hr' => 'Croatian', 'hu' => 'Hungarian', 'id' => 'Indonesian', 'is' => 'Icelandic', 'it' => 'Italian', 'ja' => 'Japanese', 'ko' => 'Korean', 'lo' => 'Lao', 'lt' => 'Lithuanian', 'lv' => 'Latvian', 'mk' => 'Macedonian', 'nl' => 'Dutch', 'no' => 'Norwegian', 'pl' => 'Polish', 'pt-BR' => 'Portuguese (Brazilian)', 'pt-PT' => 'Portuguese (Portugal)', 'ro' => 'Romanian', 'ru' => 'Russian', 'sv' => 'Swedish', 'sk' => 'Slovak', 'sl' => 'Slovene', 'sr' => 'Serbian', 'sw' => 'Swahili', 'th' => 'Thai', 'tr' => 'Turkish', 'uk' => 'Ukrainian', 'vi' => 'Vietnamese', 'zh-CN' => 'Chinese (Simplified)', 'zh-TW' => 'Chinese (Traditional)' } @yaml_line_width = Psych::Handler::OPTIONS.line_width # Psych::Handler::DumperOptions uses 0 as "default" for unset @base_controller = 'ActionController::Base' @ignore_keys = [] end |