![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
i18n-docs is a ruby gem that helps you to keep translations stored in Google Docs. This makes it easier for translators and project members to coordinate changes and updates. In addition, the standard features of Google Docs are super handy for this process: revision tracking, authorization, publishing, etc.
Although we use it with Google Docs, it could be used with any CSV file.
this gem is currently in use and tested with Rails 3.1. It probably works with other 3.x versions, but probably not 2.x at the moment.
rake i18n:find_missing_keys
)Verify the quality of this gem by checking out this repo and running:
bundle install
rake test
Add the GEM to your project:
gem 'i18n-docs'
Create a configuration file in config/translations.yml
:
files:
navigation.yml: "https://docs.google.com/spreadsheet/pub?key=ab43...34f3&single=true&gid=0&output=csv"
forms.yml: "https://docs.google.com/spreadsheet/pub?key=0Ap...XveWc&single=true&gid=0&output=csv"
... etc ...
Finally, let Rails know what locales you will be using. Add this to config/application.rb
:
module Web
class Application < Rails::Application
# add yml path
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*', '*.yml').to_s]
# locals to support:
config.i18n.available_locales = [:en,:de,:it,:fr]
end
end
This defines which languages and translation files to import from a Google Spreadsheet. The content of the Spreadsheet URL is stored to a file called e.g. example1.yml
within folders config/locales/en
and all other detected locales.
Load rake tasks in your Rakefile
:
require 'i18n-docs'
spec = Gem::Specification.find_by_name 'i18n-docs'
load "#{spec.gem_dir}/lib/tasks/store_translations.rake"
Create environment
task in your Rakefile
:
task :environment do
...
end
The minimal scope of this task is to set up I18n.available_locales
.
Translations will be stored under config/locales
in project root directory.
Don't forget to setup I18n
accordingly:
I18n.load_path = Dir[File.join(MyProject.root, 'config', 'locales', '**', '*.yml')]
And to load them:
I18n.backend.load_translations
Following Rake tasks are added by the GEM to your Rails project:
rake i18n:export_translations
Export all language files to CSV files (ENV 'locale' have to set for non-'en' locales else only files contained in 'en' folder are considered)rake i18n:import_translations
Download translations from Google Spreadsheet and save them to YAML files.rake i18n:missing_keys
Find and list translation keys that do not exist in all localesFile -> Publish To the Web
rake i18n:import_translations
in the application to get changes. You can also export yourYou can include a set of substitions for preprocessing the CSV after downloading it and before parsing it. Here is an example that replaces non-breaking spaces with normal ones.
files:
navigation.yml: "https://docs.google.com/spreadsheet/pub?key=ab43...34f3&single=true&gid=0&output=csv"
substitutions:
- from: "\u00A0"
to: ' '
I case of the error OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
when running rake i18n:import_translations
Follow this: http://stackoverflow.com/questions/12562697/opensslsslsslerror-ssl-connect-returned-1-errno-0-state-sslv3-read-server-ce?answertab=active#tab-top
Pull requests welcome!
awesome_print
from the rake task. It was breaking
downloadThis gem is sponsored by local.ch. It is licensed under the MIT license. If you're a ruby developer and want to work with us in Switzerland, please check out our jobs page.
FAQs
Unknown package
We found that i18n-docs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.