-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for PHP's gettext() #61
Comments
Hi! Evgeniy |
Hi Evgeniy, Fortunately, PHP is something I am familiar with 🙂. I created a small demo, you can see it at my fork (fork will probably be deleted some time in the future). This commit shows a demo of gettext, and includes a few sample The folder structure is as following. The LC_MESSAGES directory is a requirement of gettext. Here I used 'messages' as the domain.
A Please note that the I hope this helps you understand how gettext works. Please let me know if you need more information. Lurkie |
Awesome! |
Do I get it right that for plural translations used another function, ngettext. So, ngettext also may have several aliases? |
One more question. Here is how path to messages configured: 'translations/$lang/LC_MESSAGES/messages.po'. So the translation file itself is under LC_MESSAGES folder, and lang folder is LC_MESSAGES parent. Is it possible to configure the path this way: |
Have you tried this plugin? |
I'm not too familiar with all the nitty-gritty details of plurals, but gettext does support plurals quite well. For example, Arabic has 6 plural forms (according to the docs), and can be configured in the
The On the path layout: the structure is pretty rigid. You can select a base directory, the remaining part is fixed. Meaning: you need to work with this format: I actually have the GNU GetText files support -plugin installed, but unfortunately it only provides syntax highlighting for |
Implementation of Reference contributor
You made and merged a branch, awesome. Just to let you know, django(python) use same gettext/po tools. |
I was drawn to this plugin to assist me in our project where we use PHP
gettext()
and its related*gettext()
functions for translations using.po
and.mo
files. It seems that this plugin does not support gettext. Am I correct? If so, please consider this a feature request. If not, how should I configure this plugin for PHP gettext?The text was updated successfully, but these errors were encountered: