
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
po_and_xliff_consolidator
Advanced tools
Used to manage translation files required by a web app using .po files and an iOS app using .xliff files, consolidating them into one set of files.
For our application, we are using FastGetText[https://github.com/grosser/fast_gettext] with Rails, and then Pootle with the Git FileSystem extension to do the translations.
This gem will:
Add the following to your Gemfile:
gem 'po_and_xliff_consolidator'
Then bundle install
combine.rb
require 'po_and_xliff_consolidator'
PoAndXliffConsolidator::TranslateUnit.class_variable_set(:@@priorities,
['review template','review','task','store','photo','document','deadline'])
c = PoAndXliffConsolidator::Combine.new
c.root_file_path = __dir__
c.app_name = 'myapp' # whatever your .po files are called
c.skip_strings=['','*', '$(PRODUCT_NAME)', 'PPT','PDF']
c.skip_regexes = [/^\d+$/,/^\d+\.\d+$/,/^\d+\.\d+\.\d+$/] # 1, 1.1, 1.1.1
#c.logger.level = Logger::INFO
# We use an array for Chinese, because the .po and .xliff files are named differently
# .po first, .xliff second
languages = [
'de', 'es', ['zh_CN', 'zh-Hans']
]
languages.each do |lang|
c.process(lang)
end
extract.rb
require 'po_and_xliff_consolidator'
PoAndXliffConsolidator::TranslateUnit.class_variable_set(:@@priorities,
['review template','review','task','store','photo','document','deadline'])
c = PoAndXliffConsolidator::Extract.new
c.root_file_path = __dir__
c.app_name = 'myapp' # whatever your .po files are called
c.skip_strings=['','*', '$(PRODUCT_NAME)', 'PPT','PDF']
c.skip_regexes = [/^\d+$/,/^\d+\.\d+$/,/^\d+\.\d+\.\d+$/] # 1, 1.1, 1.1.1
#c.reset_identical_msgid_and_msgstr = true
#c.logger.level = Logger::WARN
languages = [
'de', 'es', ['zh_CN', 'zh-Hans']
]
languages.each do |lang|
c.process(lang)
end
I strongly recommend you create a new, private Git repository called say myapp-i18n
. This makes sure you can keep track on what's changed, and revert if things go wrong.
It should have a folder structure
combine.rb
extract.rb
/combined
/web-app/need-translating
/web-app/translated
/xliff/need-translating
/xliff/translated
translations-2017-01-16
rake gettext:find
myapp.po
in folders /de
/it
etc in /config/locales
/config/locales
into /web-app/need-translating/locales
translations-2017-01-16
/xliff
with the name need-translating
need-translating
already exists - overwrite? Say Yesde.xliff
in this foldermyapp-i18n
with Githubmyapp-i18n
folder, run the combine
programcombined
folder with GNU friendly names ar.po
, de.po
, etccombined
foldermyapp-i18n
with Githubmyapp-i18n
folder, or in RubyMine, run the extract
programcombined
folder back to the /xliff/translated
and /web-app/need-translating/locales
pootle fs sync myapp
againtranslations-2017-01-16
/web-app/need-translating/locales
into /config
For example:
cd ~/..path_to../myapp-web
git checkout master
git pull
git checkout translations
git merge master
git push
cp -Rv ~/..path_to../myapp-i18n/web-app/translated/locales ~/..path_to../myapp-web/config
git status
git commit -m "Update translations"
git push
Make sure you are on the correct Github branch again, say translations-2017-01-16
In the Project Navigator, go to the root of the app 'MyApp Enterprise'
Click on the 'Project' MyApp Enterprise
Select Editor..Export for Localization
Save in /xliff/need-translating
Include existing translations
This will create files named e.g. de.xliff
in this folder
FAQs
Unknown package
We found that po_and_xliff_consolidator 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.