├── .gitignore ├── Gemfile ├── example ├── en.yml ├── da.yml ├── session.en.yml └── session.da.yml ├── bin └── iye ├── test ├── test_helper.rb └── unit │ ├── test_app.rb │ ├── test_category.rb │ ├── test_transformation.rb │ ├── test_key.rb │ ├── test_translation.rb │ └── test_store.rb ├── Rakefile ├── views ├── debug.html.erb ├── categories.html.erb ├── translations.html.erb └── layout.erb ├── config.ru ├── lib ├── i18n_yaml_editor.rb └── i18n_yaml_editor │ ├── category.rb │ ├── key.rb │ ├── translation.rb │ ├── app.rb │ ├── transformation.rb │ ├── web.rb │ └── store.rb ├── CHANGES.md ├── LICENSE ├── iye.gemspec └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | Gemfile.lock 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | 5 | gem "rake" 6 | gem "minitest" 7 | -------------------------------------------------------------------------------- /example/en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | en: 3 | app_name: 4 | day_names: 5 | multiline: |- 6 | Multiple 7 | lines. 8 | -------------------------------------------------------------------------------- /bin/iye: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require "i18n_yaml_editor" 4 | 5 | iye = I18nYamlEditor::App.new(ARGV[0]) 6 | iye.start 7 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | require "minitest/autorun" 2 | require "i18n_yaml_editor" 3 | 4 | class Minitest::Test 5 | include I18nYamlEditor 6 | end 7 | -------------------------------------------------------------------------------- /test/unit/test_app.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | require "test_helper" 4 | require "i18n_yaml_editor/app" 5 | 6 | class TestApp < Minitest::Test 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/test_category.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | require "test_helper" 4 | require "i18n_yaml_editor/category" 5 | 6 | class TestCategory < Minitest::Test 7 | end 8 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake/testtask' 2 | 3 | Rake::TestTask.new do |t| 4 | t.libs << "test" 5 | t.libs << "lib" 6 | t.pattern = "test/**/test_*.rb" 7 | end 8 | 9 | task :default => :test 10 | -------------------------------------------------------------------------------- /views/debug.html.erb: -------------------------------------------------------------------------------- 1 | 2 |
3 |4 | <% translations.each do |translation| %> 5 | <%= Rack::Utils.escape_html(translation.inspect) %> 6 | <% end %> 7 |8 | 9 | 10 | -------------------------------------------------------------------------------- /example/da.yml: -------------------------------------------------------------------------------- 1 | --- 2 | da: 3 | app_name: 4 | day_names: 5 | - søndag 6 | - mandag 7 | - tirsdag 8 | - onsdag 9 | - torsdag 10 | - fredag 11 | - lørdag 12 | multiline: |- 13 | Her er 14 | flere 15 | linjer. 16 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | $:.unshift("lib") 2 | 3 | require "i18n_yaml_editor/app" 4 | require "i18n_yaml_editor/web" 5 | 6 | app = I18nYamlEditor::App.new("example") 7 | app.load_translations 8 | app.store.create_missing_keys 9 | 10 | run I18nYamlEditor::Web 11 | -------------------------------------------------------------------------------- /lib/i18n_yaml_editor.rb: -------------------------------------------------------------------------------- 1 | module I18nYamlEditor 2 | class << self 3 | attr_accessor :app 4 | end 5 | end 6 | 7 | require "i18n_yaml_editor/app" 8 | require "i18n_yaml_editor/category" 9 | require "i18n_yaml_editor/key" 10 | require "i18n_yaml_editor/store" 11 | require "i18n_yaml_editor/transformation" 12 | require "i18n_yaml_editor/translation" 13 | require "i18n_yaml_editor/web" 14 | -------------------------------------------------------------------------------- /views/categories.html.erb: -------------------------------------------------------------------------------- 1 |
| 5 | "><%= category.name %> 6 | | 7 |