Skip to content

Added extension to smarty to properly set up locale related settings#7

Closed
tboloo wants to merge 6 commits intosmarty-gettext:masterfrom
tboloo:setting_locale_support
Closed

Added extension to smarty to properly set up locale related settings#7
tboloo wants to merge 6 commits intosmarty-gettext:masterfrom
tboloo:setting_locale_support

Conversation

@tboloo
Copy link
Copy Markdown

@tboloo tboloo commented Feb 8, 2015

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.

@glensc
Copy link
Copy Markdown
Member

glensc commented Feb 9, 2015

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)

@tboloo
Copy link
Copy Markdown
Author

tboloo commented Feb 9, 2015

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 :/

@glensc
Copy link
Copy Markdown
Member

glensc commented Feb 9, 2015

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)

@glensc
Copy link
Copy Markdown
Member

glensc commented Feb 9, 2015

also, i prefer not storing binary content (.mo) in git. should keep only source (.po) and rebuild if needed

Comment thread function.locale.php Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use current project url here

@tboloo
Copy link
Copy Markdown
Author

tboloo commented Feb 9, 2015

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).
$smarty->joined_template_dir indeed would work for smarty3, template_dir should work for Smarty2 as well (haven't tested it though)

@glensc
Copy link
Copy Markdown
Member

glensc commented Apr 18, 2015

sorry, this was all too messy, so i cleaned it up, and squashed into one commit c12ac35

@glensc glensc closed this May 11, 2015
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

Successfully merging this pull request may close these issues.

2 participants