php - How to use compiled gettext .mo files without the gettext module? -
i'm trying find way use gettext , friends without depending on official gettext module, i've found not installed everywhere , yields different results depending on os , server configuration.
i make library can auto load po file, change languages , translate text between {t} , {/t} in view, posted here in case 1 want use instead calling gettext function in view:
the view code might be:
<html> <head> <title>{blog_title}</title> </head> <body> <h3>{blog_heading}</h3> {blog_entries} <h5>{t}title is{/t} {title}</h5> <p>{t 1="<b>" 2="</b>"}click here %1to see%2 me{/t}{body}</p> <p>{t 1="{id}" 2="author"}the id is: %1 wrote %2{/t}</p> <p>{t 1="<a href=\"link here\">" 2="</a>"}please lick on me%2{/t}</p> {/blog_entries} </body> </html>
Comments
Post a Comment