Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Broken translations when the msgids contain non-ASCII characters #1

Merged
merged 1 commit into from

2 participants

@ujh

I'm currently working on a project where we're using German as the source language. The problem is that when there are non-ASCII characters in the msgids then the translations can't be found because the keys aren't properly encoded when loading the *.mo file. It's probably just an oversight as the msgstrs are properly encoded.

I wasn't able to make the tests pass before adding this patch so I'm not sure how useful it is. However, I thought it would be better to mention it anyway.

@kou kou merged commit 0c0f996 into ruby-gettext:master
@kou
Owner

Thanks! I've merged your pull request!

@ujh

Great, thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 30, 2012
  1. Encode the msgids too when loading an MO file

    Urban Hafner authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/gettext/runtime/mofile.rb
View
2  lib/gettext/runtime/mofile.rb
@@ -155,7 +155,7 @@ def load_from_stream(io)
str = convert_encoding(str, original_strings[i])
end
end
- self[original_strings[i]] = str.freeze
+ self[convert_encoding(original_strings[i], original_strings[i])] = str.freeze
end
self
end
Something went wrong with that request. Please try again.