From 03c4eca9b0d94e57e6c48f06480c7e96bb2aefce Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Thu, 12 Sep 2024 02:57:20 +0400 Subject: [PATCH] Implement localization --- .gitignore | 1 + .gitmodules | 3 +++ Gemfile | 5 +++++ exe/repubmark | 5 +++++ vendor/rails-i18n | 1 + 5 files changed, 15 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 Gemfile create mode 160000 vendor/rails-i18n diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..66f8ed3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/Gemfile.lock diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2b917a6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/rails-i18n"] + path = vendor/rails-i18n + url = https://github.com/svenfuchs/rails-i18n.git diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..c46caed --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +gem 'i18n', '~> 1.14' diff --git a/exe/repubmark b/exe/repubmark index 137632e..fa15677 100755 --- a/exe/repubmark +++ b/exe/repubmark @@ -6,8 +6,13 @@ $LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib require 'bundler/setup' +require 'i18n' require 'repubmark' +I18n.load_path = Dir[ + Pathname.new(__dir__).join('../vendor/rails-i18n/rails/locale/**/*.yml') +].each(&:freeze).freeze + config_filename = String(ARGV[0]).freeze profile = String(ARGV[1]).freeze diff --git a/vendor/rails-i18n b/vendor/rails-i18n new file mode 160000 index 0000000..10141c4 --- /dev/null +++ b/vendor/rails-i18n @@ -0,0 +1 @@ +Subproject commit 10141c451f03d7c6b78cfdcce808c389da6b9ddd