Added extension to smarty to properly set up locale related settings#7
Added extension to smarty to properly set up locale related settings#7tboloo wants to merge 6 commits intosmarty-gettext:masterfrom tboloo:setting_locale_support
Conversation
|
looks okay, but would you mind digging up more docs? what what does "stack=push" and "stack=pop" do, and how to use (i.e add more examples) |
|
OK, I cleaned the code, removed the stack operations and added tests, although I do not know how to make them pass the Travis CI build :/ |
|
meh. why you removed stack, i asked only to find and add docs for that, i think pushing and poping locale state is very useful. as for travis, ignore errors from php 5.2, travis removed it's support (fixed already on master) |
|
also, i prefer not storing binary content (.mo) in git. should keep only source (.po) and rebuild if needed |
There was a problem hiding this comment.
please use current project url here
|
So I've changed the array syntax, updated project url. As far as *.mo files are concerned - tests would't pass without them, and compiling them before each run would require msgfmt to be installed and run, so I'll leave it up to your decision. As far as stack operation - I didn't find any useful documentation, so I came up with a test which shows how it might be used (more of a guess then real knowledge). |
|
sorry, this was all too messy, so i cleaned it up, and squashed into one commit c12ac35 |
Disclaimer - this is not my original work, I merely copied it from https://code.google.com/p/smarty-gettext/
Anyway - with this additional file one is able to setup locale related stuff (textdomain, etc) from master smarty template via {locale path="{$smarty.current_dir}/PATH_TO_LOCALIZATION_FILES" domain="YOUR_TRANSLATION_DOMAIN(default 'messages'"}
If you find it useful - merge.