nicosantangelo / sublime-text-i18n-rails

Sublime Text 2/3 package for Rails Internationalization
MIT License
18 stars 3 forks source link

Unicode symbols in locale file #4

Closed jastkand closed 10 years ago

jastkand commented 10 years ago

If my locale file includes any unicode symbols in particular cyrillic dialog for adding new translation does not appear.

Traceback:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "i18n_rails in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 92, in run
  File "i18n_rails in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 101, in process
  File "i18n_rails in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 105, in existing_text_from_yaml
  File "yaml in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 29, in text_from
  File "yaml in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 45, in read_file
  File "pyyaml in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 70, in load
  File "pyyaml.loader in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 34, in __init__
  File "pyyaml.reader in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 85, in __init__
  File "pyyaml.reader in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 124, in determine_encoding
  File "pyyaml.reader in /Users/andrey/Library/Application Support/Sublime Text 3/Installed Packages/I18n Rails.sublime-package", line 178, in update_raw
  File "X/encodings/ascii.py", line 26, in decode
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 14: ordinal not in range(128)

index.html.erb:

<p><%= t('test.test') %></p>

ru.yml:

ru:
  hello: "Привет мир"
nicosantangelo commented 10 years ago

Let me know if you run into more problems with this, thanks for the help!

jastkand commented 10 years ago

I'm sorry to say that but it still does not work. I have reinstalled the plugin to get the latest version of it and it gives me the same traceback. But it looks like this it the issue in one of the sublime modules as when I unzip package and put it to Packages directory the plugin starts to work.

nicosantangelo commented 10 years ago

Aw, I tried it with the package unziped as well. I can't think of a fix off the top of my head, but I'll take a look.

jastkand commented 10 years ago

The issue has been resolved somehow. It does not appear any more.

nicosantangelo commented 10 years ago

That's weird but good. Since the pull request I wasn't able to reproduce the error but I have in mind testing in other platforms. I'll close this but keep an eye on it in case I happens again.

Thank you very much for the help!

jastkand commented 10 years ago

I will let you know if the issue will happen again. Thank you for the plugin, it's very useful!