![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
About this repo | How to use this repo | Contribute to this repo
Internationalization is a hard and tedious process. Different character sets, different average word length, different pluralization rules... There's a lot going on and it's impossible to test against all possible scenarios. As a side effect, most of us will simply test against one or two known languages and hope for the best. Unfortunately, this often leads to broken UI elements, texts going out of bounds, or forgotten non-translated strings making their way into a final release.
As an example, let's examine the string "Set the power switch to 0.";
Language | String | Characters | Percentage |
---|---|---|---|
English | Set the power switch to 0. | 26 chars | - |
French | Placez l'interrupteur de tension à 0. | 37 chars | 42% more |
Spanish | Ponga el interruptor de alimentación de corriente en 0. | 55 chars | 112% more |
It's easy to see that any hardcoded widths would likely break giving such a string. IBM suggests that on average, we should expect any English string to inflate by 30% when translating in another language.
In an attempt to ease this whole process, we created a small tool that gives you the ability to preview your product with pseudo-translations in a way that will;
Add these lines to your application's Gemfile:
group :development do
gem 'pseudolocalization', require: false
end
Execute:
$ bundle
Finally, in an initializer, add the following lines:
if Rails.env.development? && ENV["I18N_BACKEND"]
case ENV["I18N_BACKEND"]
when 'pseudolocalization'
require 'pseudolocalization'
I18n.backend = Pseudolocalization::I18n::Backend.new(I18n.backend)
end
end
When working on internationalization, you can boot your server with the pseudolocalization backend to quickly identify content that doesn't go through the I18n framework.
I18N_BACKEND=pseudolocalization bundle exec rails server
You may wish to have the backend ignore specific keys. These may be configured via an array, ignores
, on the backend. The array can contain a mix of strings (with globbing allowed) and/or Regexes.
I18n.backend = Pseudolocalization::I18n::Backend.new(I18n.backend)
I18n.backend.ignores = ['ignored*', /Waldo.$/]
bundle exec rake test
Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/pseudolocalization.
FAQs
Unknown package
We found that pseudolocalization demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.