mrmans0n / localio Goto Github PK
View Code? Open in Web Editor NEWAutomatically create localizable files for Android, iOS, Rails, Java, Windows apps and more!
License: MIT License
Automatically create localizable files for Android, iOS, Rails, Java, Windows apps and more!
License: MIT License
Hey there!
I use your tool for iOS development in order to localize all my strings. Lately I've moved my deploys to fastlane in order to automate my builds. I would like to integrate localio as one step inside fastlane but there is a dependency issue with google-api-client
:
Bundler could not find compatible versions for gem "google-api-client":
In Gemfile:
google-api-client (< 0.9)
fastlane was resolved to 2.3.0, which depends on
google-api-client (~> 0.9.1)
Is this possible?
Happy new year 🎉
Sorry if I overlooked the documentation, just wonder if localio does auto conversion between Android and iOS string formats? For example, cell value of name: %@
is converted to:
name: %s
name: %@
If the excel contains a region variant valid for IOS (i.e, "pt-br"), the values resource folder is not created with the Android correct format , which is: values-[locale]-r[region](it should be)
When configuring the source as "xlsx", localio only detects one language, the first column. I tested with the same file exported to "xls" and it works great.
I have this error but all is well configured.
Why?
Service: csv
Invalid format: Could not find any [key] keyword in the A column of the CSV file
[key];en;it
hi;Hi;Ciao
platform :swift
formatting :none
output_path '../Resources/Translations'
source :csv,
:path => 'pippo.csv',
:column_separator => ';'
Android generation should change "..." (3 points) with the ellipsis character "…", to avoid the lint check warning.
Hi guys,
with localio 0.1.7, importing xlsx file, we have this error:
Service: xlsx undefined method
downcase' for nil:NilClass`
When reverted to 0.1.6 everything starts to work fine again.
Thanks
Alberto
Example excel sheet: http://prntscr.com/iob5yx
Converted Android key: http://prntscr.com/iob6be
Can we maintain the uppercase letters?
Let me know if I'm wrong but I wasn't able to find how to specify a custom name for the generated .strings file. We have multiple string tables and need to have a name other than Localizable.strings. Would you be able to add that as a configurable parameter?
Thank you for creating localio,
however, my generated Localizable.string file has its key prefixed with "_". I don't understand why my key can not be as same as in excel file.
Could you fix this issue?
Hi.
I've tryed to run "localize" and putted the URL, copy the code, paste it on the terminal, but at the end, it shows the error:
"Insufficient Permission: Request had insufficient authentication scopes."
At this point everytime I try to run "localize" command, I received this return without prompting Google Drive URL to try again.
Paste output:
Service: google_drive
Logging in to Google Drive...
Refreshing auth token...
Store auth data...
Logged in!
Insufficient Permission: Request had insufficient authentication scopes.
How can I force it to retry full flow?
Thanks
In Xcode 6.4 & iOS 8, the generated file "LocalizableConstants.swift" doesn't compile.
I was going to submit a PR myself, but I don't have credentials. To fix this, you only need to add "import Foundation" to the "swift_constant_localizable.erb" template.
I get this error when using localise:
$ localize
/usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/localio-0.0.12/lib/localio/writers/android_writer.rb:39: invalid multibyte char (US-ASCII) (SyntaxError) /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/localio-0.0.12/lib/localio/writers/android_writer.rb:39: invalid multibyte char (US-ASCII) /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/localio-0.0.12/lib/localio/writers/android_writer.rb:39: syntax error, unexpected $end, expecting ')' term.gsub('&', '&').gsub('...', '…').gsub('%@', '%s') ^ from /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/localio-0.0.12/lib/localio/localizable_writer.rb:1:in <top (required)>' from /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/localio-0.0.12/lib/localio.rb:4:in
<top (required)>'
from /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from /usr/local/var/rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/localio-0.0.12/bin/localize:3:in <top (required)>' from /usr/local/var/rbenv/versions/1.9.3-p429/bin/localize:23:in
load'
from /usr/local/var/rbenv/versions/1.9.3-p429/bin/localize:23:in `
Any idea?
Thanks!
I need to generate strings and constants for both Objective-C and Swift. I tried to accomplish this by assigning platform :ios, :swift
but this simply gives the error "no implicit conversion of Symbol into Integer". Is it possible to do this some other way?
Hello,
this is my Locfile:
platform :ios
output_path 'my_output_path/'
source :google_drive,
:spreadsheet => '[Localizables] Localio example',
:client_id => ENV['CLIENT_ID'],
:client_secret => ENV['CLIENT_SECRET']
when I run localize I get the URL to open in order to activate the API and get the code (4/AADb3pZBF1LtZM6QHTQEW0j04A1-DF-yLp4Gd9lyFO-p_-jEGW1RbOs). When I paste the code I get the following:
Error: #<ArgumentError: header field value cannot include CR/LF>
Couldn't access Google Drive. Check your values for :client_id and :client_secret, and delete :access_token if present (you might need to refresh its value so please remove it)
I don't really know why. Could it be a encoding issue?
Thank you
Marco
I can successfully load the translation using OAuth, however a few minutes later I try and it says invalid credentials:
Logging in to Google Drive...
Logged in!
Spreadsheet found. Analyzing...
Languages detected: en, es -- using en as default.
Building terminology in memory...
Loaded!
Writing iOS translations...
> en
> es
> LocalizableConstants.h
Done!
Logging in to Google Drive...
Logged in!
Invalid Credentials
Hi, I'm trying to generate files for my iOS app.
I've noticed that double quotes aren't escaped.
Also, new lines within the translation are untouched, meaning the iOS code has syntax errors.
So I've modified the following in the ios_writer.rb
translation = term.values[lang].gsub('"', %q(\\\")).gsub("\n", "\\n")
Keep in mind that my Ruby knowledge is limited, so I'd like to know if there's a better way to do this, or if there's no actual bug within the gem and my approach is wrong.
Thank you,
Peter
Hi,
Keep in mind that I have no experience with ruby, I'm just trying to generate translation files for my iOS app.
My Locfile uses a basic xlsx source:
platform :ios
output_path :'/absolute/path/to/project/'
source :xlsx,
:path => 'Strings.xlsx'
formatting :smart
When I run localize
, I get:
Languages detected: en, ru, zh, fr, es, ar, pt, ja -- using en as default.
Building terminology in memory...
Loaded!
Writing iOS translations...
no implicit conversion of Symbol into String
So I've started debugging and I've changed the following in localio/writers/ios_writer.rb
:
languages.keys.each do |lang|
output_path = File.join(path**.to_s**, "#{lang}.lproj/")
and
if create_constants && !constant_segments.nil?
TemplateHandler.process_template 'ios_constant_localizable.erb', path**.to_s**, 'LocalizableConstants.h', constant_segments
puts ' > ' + 'LocalizableConstants.h'.yellow
end
And now the I've successfully generated my files.
Question is: is my Locfile wrong? Is this an actual bug in the gem?
Thank you,
Peter
Right now what happens is that if there is a cell in spreadsheet
which doesn't have a value the localized strings are not generated and we get error
mentioned below
undefined method
gsub' for nil:NilClass`
There should be an option to skip
these cells so that localized strings are generated for the whole file and the cells which don't have a value are skipped.
The reason this is important is because sometime we don't use localized strings at all places and so they are left out as blank
in the spreadsheet and if we use localio then it fails to generate localized strings.
Hi;
I am using Localio for both Android and IOS translations.
Android do not accept apostrophes in the value field. So I needed to put quotes if it contains apostrophes.
But if I extract for IOS, it puts extra quotes and xcode doesn't accept that.
What can I do for such situation?
ruby-2.6.0/gems/google-api-client-0.7.1/lib/google/api_client/request.rb:16:in `require': cannot load such file -- faraday/request/multipart
when calling localize
Support plurals in some way, taking into account:
it would be great if we have an option to pick a worksheet
in the spreadsheet
. Instead of just localizing
the first worksheet
the user should specify which worksheet
he wants to localize
using the name of worksheet
.
Something like this
platform :android
output_path 'res/'
source :xlsx,
:path => 'sheet.xlsx'
worksheet: "sheet3"
I have few unicode chars in my localizations file, for example: "& #x25BC;". Localio changing "&" in cell to "& amp;", and whole string is "& amp;#x25BC;" [without white spaces]. I've tried some escape characters, but none works.
There is anyway to integrate localio in fastlane? I haved problems also setting variable environment CLIENT_SECRET and CLIENT_ID.
Any process to try to integrate localio in a fastlane task?
Hi!
I found your project and it seems really interesting to me, but I have some issues making it work..
I prepared the following Locfile:
platform :ios
source :xls, :path => 'traduzioni.xls'
output_path 'sterilizzatrici/Localizables/'
formatting :smart
and when I call localize
it fails with this error message:
Languages detected: it, en, fr, de -- using en as default.
Building terminology in memory...
Loaded!
Writing iOS translations...
> it
undefined method `replace_escaped' for nil:NilClass
Any idea what's going on? I am using
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin14.0]
and
localio (0.0.23)
Unfortunately, if an excel cell contains a line wrap element, that moves into the Localizable.strings, and this occurs an invalid format. Is there any solution to remove the line breaks from the content?
We use a spreadsheet like the basic example in Google Drive.
In our Locfile
we specify the platform: json
that produces multiple "___comment___"
keys.
Now we have problems reading the produced strings-xyz.json
localization files with some JSON-parsers that don't allow duplicated keys.
Is there a way to ignore these [COMMENT] rows for the json platform completely?
Add a new file type target, a java properties file for storing translations.
The idea would be to make a language_{iso_code}.properties files with the properties specified with the likes of:
# comment
key1=translation1
key2=translation2
After typing in the command "localize", the URL provided under:
Logging in to Google Drive...
1. Open this page in your browser:
is not valid anymore. For example, the link could be something like below:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=XXXXXX-XXXXXXXXXXXXXXXXX.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://docs.google.com/feeds/https://www.googleapis.com/auth/drive%20https://spreadsheets.google.com/feeds
Google will give out an error of invalid scope (https://prnt.sc/qsil8s) Even if I managed to change the URL to get a verification code, later when I run the "localize" command, I always get the below error:
Service: google_drive
Logging in to Google Drive...
Refreshing auth token...
Store auth data...
Logged in!
Spreadsheet found. Analyzing...
Unable to retrieve the first worksheet from the spreadsheet. Are there any pages?
The same method works on my Mac, since I linked it before the URL has issues, but now when I'm trying to set up my windows, the URL has scope issues and the spreadsheet cannot be found...So i think it could be related to the URL. Can you help with this please? Thank you very much!
When adding a row on google drive spreadsheet starting with + or =, google asks you to add ' at the beginning so it doesn't treat the value as a formula, this char (') appears in the generated files.
For example, translation of "Item doesn't exist" would be:
<string name="not_exists">Item doesn't exist</string>
where it is expected to be:
<string name="not_exists">Item doesn\'t exist</string>
See: https://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling
A warning appears when you use GoogleDrive:
WARNING: GoogleDrive.login is deprecated and will be removed in the next version. Use GoogleDrive.login_with_oauth instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.