Open abrisse opened 11 years ago
Generally your idea looks good. FYI, I went with a "localized string" in my Redlander stack: https://github.com/cordawyn/xml_schema/tree/master/lib/ext
What I don't like is that you made it a "has_many" relation. This design would not be an obvious one for ActiveRecord-renegades, I'm afraid. At least, if we follow the Principle of Least Surprise. I believe that the nuances of internal implementation should not surface in this case: there should be plenty of libraries that rely in the fact that has-many relates to a collection (with the name specified in plural too).
Could you move your code to "property" from "has_many" instead? I expect that there should be many adjustments throughout the code to accommodate for that, though.
Thanks for the feedback Slava. You are completely right concerning the has_many relation. I have forgotten to modify it, since my previous implementation allowed a user to define multiple labels per language. That explains too the use of select + map in _unserialize_localizedproperties.
I will update my code and will make you a pull request.
See the original thread Support language tags for literals.
I have tried to work on that issue and have push a commit on one of my branches.
Can you read the spec and give me a feedback ? Thanks.