From 3ba9337d06293547d90815b181c7f1c0194eb513 Mon Sep 17 00:00:00 2001 From: Elijah Krukowski Date: Sat, 28 Jan 2023 05:51:13 +0200 Subject: [PATCH 1/3] [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d220cd..3043f8c 100644 --- a/README.md +++ b/README.md @@ -169,4 +169,4 @@ end ## License -Copyright (c) [Lokalise team](http://lokalise.com), [Ilya Krukowski](http://bodrovis.tech). License type is [MIT](https://github.com/bodrovis/lokalise_rails/blob/master/LICENSE). +Copyright (c) [Ilya Krukowski](http://bodrovis.tech). License type is [MIT](https://github.com/bodrovis/lokalise_rails/blob/master/LICENSE). From c1cccd17f3d2fd9adc2bb01e655f99862490106e Mon Sep 17 00:00:00 2001 From: Elijah Krukowski Date: Sat, 28 Jan 2023 05:51:40 +0200 Subject: [PATCH 2/3] [skip ci] --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index a899ed1..9534806 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Lokalise team, Ilya Krukowski +Copyright (c) 2023 Ilya Krukowski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the From 2d8b0d3ae4ff5f30ded3fc95c78a9ca958b04860 Mon Sep 17 00:00:00 2001 From: Elijah Krukowski Date: Thu, 11 May 2023 13:14:00 +0300 Subject: [PATCH 3/3] Update README.md --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 3043f8c..7b01f98 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,30 @@ importer.import! exporter.export! ``` +### Example: Multiple translation paths + +Creating custom import/export script can come in really handy if you have a non-standard setup, for instance, your translation files are stored in multiple directories (not only in the default `./config/locales`. To overcome this problem, create a custom Rake task and provide as many importers/exporters as needed: + +```ruby +require 'rake' +require 'lokalise_rails' +require "#{LokaliseRails::Utils.root}/config/lokalise_rails" + +namespace :lokalise_custom do + task :export do + # importing from the default directory (./config/locales/) + exporter = LokaliseManager.exporter({}, LokaliseRails::GlobalConfig) + exporter.export! + + # importing from the custom directory + exporter = LokaliseManager.exporter({locales_path: "#{Rails.root}/config/custom_locales"}, LokaliseRails::GlobalConfig) + exporter.export! + rescue StandardError => e + abort e.inspect + end +end +``` + ## Configuration Options are specified in the `config/lokalise_rails.rb` file.