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

Already on GitHub? Sign in to your account

I18n and the empty string #101

Closed
omegahm opened this Issue Mar 18, 2013 · 5 comments

Comments

Projects
None yet
3 participants
Contributor

omegahm commented Mar 18, 2013

The following spec fails:

def test_localized_html_entities_conversion_with_blank_replacement
    Stringex::Localization.backend = :internal
    Stringex::Localization.store_translations :da, :html_entities, {
       :nbsp => ""
    }
    Stringex::Localization.locale = :da

    {
      "Det var blå sort" => "Det var blåsort"
    }.each do |entitied, plain|
      assert_equal plain, entitied.convert_miscellaneous_html_entities
    end
end

"Det var blå sort".convert_miscellaneous_html_entities returns "Det var blå sort" with the default replacement for   still in place.

Owner

rsl commented Mar 18, 2013

i am not sure of the point here. that's not the actual test.

Contributor

omegahm commented Mar 18, 2013

No, this is one I wrote on the fly. The point is that the empty replacement is ignored. I would expect   in my string to be replaced by "", but that is not the case.

Owner

rsl commented Apr 29, 2013

is this still the case on master now?

Contributor

lassebunk commented Apr 29, 2013

Hej @omegahm. @rsl Not anymore.. well, if you merge ;)

@rsl rsl closed this in a329fcb Apr 29, 2013

rsl added a commit that referenced this issue Apr 29, 2013

Owner

rsl commented Apr 29, 2013

fixed by the always amazing @lassebunk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment