Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
= Gettext OneSky
OneSky[link:http://www.oneskyapp.com] is a new service that lets developers reach a global audience by easily enabling them to translate their websites and applications to different languages through the help of the community.
This gem integrates OneSky and gettext. At its most basic, it allows you to take the phrases defined under gettext .pot file and upload it to OneSky[link:http://www.oneskyapp.com] for translation by the community. Afterwards, you can download available translations and save them as .po files.
This gem is supporting Ruby projects using gettext gem to handle localization. If you are using i18n, checkout i18n-one_sky gem
= PO file support
--- One layer of Context
Onesky currently only support 1 layer of context. That means only either "msgctxt" / "msgstr[0]" / "msgstr[1]" will be supported but not both.
--- Text Domain as page
Regarding the text domain, please use the file name as the page parameter. That means if the po file is abc.po, just add the string with parameter page=abc.po.
--- Reserved Context: Singular, Plural and General
"Singular" / "Plural" / "General" are reserved context words.
Onesky only support "Singular" and "Plural" for po files. That means only [0] and [1] are used. Which will return in result:
{"key": { "Singular": "Word", "Plural": "Words"}}
For the stuff without context, you may use "General" if there are other strings with same string key but different context:
{"key_of_book": { "General": "book", "verb": "book", "noun": "book"}}
= Using inside a Rails project
--- Generate OneSky API key
If you haven't done so yet, log in to your account at OneSky[link:http://www.oneskyapp.com] and create a new project for this Rails app. Also, find the API key and secret which you will supply here:
rails generate one_sky:init my_api_key my_api_secret my_project
This will create the configuration file config/one_sky.yml.
--- Generate .pot
Use the gettext rake task
rake updatepo
--- Upload .pot to OneSky
So assuming that you already have your .pot file generated, it's time now to submit these phrases to OneSky:
rake one_sky:upload_phrases
--- Upload translated .po to OneSky
You may have some translated .po files in your repository. Upload them to Onesky:
rake one_sky:upload_translated_phrases
--- Download latest translated files .po from OneSky
Then ask your translators to provide the translations using the OneSky[link:http://www.oneskyapp.com] website. When they're done and a few new languages are available, download them by:
rake one_sky:download_translations
This will save the translations inside po/**/from_one_sky.po files.
--- Overwrite old .po files
Overwrite your own .po files by the downloaded from_one_sky.po file.
You now have more languages supported and it's just a matter of pushing again to production. You can call upload and download over and over as you incrementally internationalize your site.
= Using outside Rails
The steps are similar. Install it like any regular gem:
gem install gettext-one_sky
And see the gettext-one_sky.rake and GetText::OneSky::SimpleClient for the methods available in Ruby.
= TODO
= History
See CHANGELOG[link:CHANGELOG.html]
= Credits
See CREDITS[link:CREDITS.html]
= License
Copyright 2010-2011 {OneSky, Inc.}[link:http://www.oneskyapp.com]
Licensed under the {MIT License}[link:MIT-LICENSE.html].
FAQs
Unknown package
We found that gettext-one_sky demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.