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

WikiCloth's i18n module is broken #61

Closed
avtobiff opened this issue Jun 8, 2013 · 2 comments
Closed

WikiCloth's i18n module is broken #61

avtobiff opened this issue Jun 8, 2013 · 2 comments

Comments

@avtobiff
Copy link

avtobiff commented Jun 8, 2013

Executing WikiCloth using the supplied wikicloth/i18n does not work.
Using the i18n gem works as expected

Steps to reproduce (using default wikicloth)

irb(main):001:0> require 'wikicloth'
=> true
irb(main):002:0> WikiCloth::WikiCloth.new(:data => "__TOC__\n\n= One =\n\nwth").to_html(:noedit => true)
NoMethodError: undefined method `has_key?' for nil:NilClass
from /usr/lib/ruby/vendor_ruby/wikicloth/i18n.rb:25:in `t'
from /usr/lib/ruby/vendor_ruby/wikicloth.rb:96:in `rescue in render'
from /usr/lib/ruby/vendor_ruby/wikicloth.rb:78:in `render'
from /usr/lib/ruby/vendor_ruby/wikicloth.rb:109:in `to_html'
from (irb):2
from /usr/bin/irb:12:in `<main>'

Expected result (performing require 'i18n' before I18n check in lib/wikicloth.rb):

irb(main):001:0> require 'wikicloth'
=> true
irb(main):002:0> WikiCloth::WikiCloth.new(:data => "__TOC__\n\n= One =\n\nwth").to_html(:noedit => true)
=> "\n\n\n\n<h1><a name=\"One\"></a><span class=\"mw-headline\" id=\"One\">One</span></h1>\n\n\n\n<p>wth</p>"
@nricciar
Copy link
Owner

Could you tell me what your default locale is? I suspect this may be because its trying to reference a locale it does not have translations for, but I just wanted to get a little more information first before I try resolving this issue.

@avtobiff
Copy link
Author

Nice that you fixed it!

More info:

$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

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

2 participants