Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem converting using cvs2strings #86

Closed
romk1n opened this issue Feb 26, 2016 · 6 comments
Closed

problem converting using cvs2strings #86

romk1n opened this issue Feb 26, 2016 · 6 comments

Comments

@romk1n
Copy link

romk1n commented Feb 26, 2016

Hi, i am trying to get a header with all the macros for localization in our project.

  1. I took our localization strings and used babelish to create cvs file. by running babelish strings2csv -i Localizable.strings
  2. Without modifications i know want to make a conversation back using babelish csv2strings -i translations.csv -L English:en however i am getting the following error
babelish csv2strings -i translations.csv -L English:en
/usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/lib/babelish/csv2base.rb:139:in `block (2 levels) in convert': undefined method `add_content_pair' for nil:NilClass (NoMethodError)
    from /usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/lib/babelish/csv2base.rb:113:in `times'
    from /usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/lib/babelish/csv2base.rb:113:in `block in convert'
    from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/csv.rb:1739:in `each'
    from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/csv.rb:1122:in `block in foreach'
    from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/csv.rb:1273:in `open'
    from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/csv.rb:1121:in `foreach'
    from /usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/lib/babelish/csv2base.rb:102:in `convert'
    from /usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/lib/babelish/commandline.rb:153:in `block in csv2base'
    from /usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/lib/babelish/commandline.rb:145:in `each'
    from /usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/lib/babelish/commandline.rb:145:in `each_with_index'
    from /usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/lib/babelish/commandline.rb:145:in `csv2base'
    from /usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/lib/babelish/commandline.rb:37:in `block (2 levels) in <class:Commandline>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/lib/ruby/gems/2.2.0/gems/babelish-0.5.0/bin/babelish:6:in `<top (required)>'
    from /usr/local/bin/babelish:23:in `load'
    from /usr/local/bin/babelish:23:in `<main>'
@romk1n romk1n changed the title problems converting using cvs2strings problem converting using cvs2strings Feb 26, 2016
@netbe
Copy link
Owner

netbe commented Mar 2, 2016

Could you post the Localizable.strings that you had?

@romk1n
Copy link
Author

romk1n commented Mar 9, 2016

@netbe sorry for the late response. for security reason's i cannot paste the hole .csv but here the snippet

Variables,Localizable.strings
%ld minutes ago,%ld minutes ago,Text displaying number of minutes ago
%ld months ago,%ld months ago,Text displaying number of months ago
%ld seconds ago,%ld seconds ago,Text displaying number of seconds ago
%ld weeks ago,%ld weeks ago,Text displaying number of weeks ago
%ld years ago,%ld years ago,Text displaying number of years ago

if i delete the top line, i don't get an error but output is 0 files

@romk1n
Copy link
Author

romk1n commented Mar 10, 2016

also if that helps i have ruby version

ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]

@netbe
Copy link
Owner

netbe commented Mar 14, 2016

@romk1n the resulting Localizable.strings is wrong missing the Comments in header I guess.
Quick fix : Change the translations.csv file header by Variables,English,Comments

I am going to look at the generation strings2csv

@netbe netbe closed this as completed in 25bec1c Mar 15, 2016
@netbe
Copy link
Owner

netbe commented Mar 15, 2016

Fixed in 0.5.1

@gsantoscarrot
Copy link

Traceback (most recent call last):
14: from C:/Ruby25-x64/bin/babelish:23:in <main>' 13: from C:/Ruby25-x64/bin/babelish:23:in load'
12: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/babelish-0.5.4/bin/babelish:6:in <top (required)>' 11: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in start'
10: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in dispatch' 9: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command'
8: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in run' 7: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/babelish-0.5.4/lib/babelish/commandline.rb:38:in block (2 levels) in class:Commandline'
6: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/babelish-0.5.4/lib/babelish/commandline.rb:150:in csv2base' 5: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/babelish-0.5.4/lib/babelish/commandline.rb:150:in each_with_index'
4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/babelish-0.5.4/lib/babelish/commandline.rb:150:in each' 3: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/babelish-0.5.4/lib/babelish/commandline.rb:157:in block in csv2base'
2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/babelish-0.5.4/lib/babelish/commandline.rb:157:in new' 1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/babelish-0.5.4/lib/babelish/csv2android.rb:6:in initialize'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/babelish-0.5.4/lib/babelish/csv2base.rb:26:in `initialize': wrong value of filename: nil (ArgumentError)

I have ruby 2.5.5p157 (2019-03-15 revision 67260) [x64-mingw32]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants