Skip to content
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

Specify domain #4

Closed
Chris98 opened this issue Jan 1, 2021 · 6 comments · Fixed by #5
Closed

Specify domain #4

Chris98 opened this issue Jan 1, 2021 · 6 comments · Fixed by #5
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Chris98
Copy link
Contributor

Chris98 commented Jan 1, 2021

Not relating to PhpMyAdmin as a software, but in a custom Twig project I'm trying to use this code's fork. I've realised that I don't seem to be able to specify a domain with the translation string?

According to this SO link from several years ago, you could use code such as the following to translate from a specific domain: https://stackoverflow.com/a/7690325

i.e.

{% trans from "domain" %}text{% endtrans %}

Is this still a feature or has it been removed? I've checked through the extension code and don't seem to be able to find anything hinting at this.

In my Twig I'm using code such as the following:

{% trans from "core" %}en{% endtrans %}

And I'm getting errors like the following:

'Unexpected token "string" of value "core" ("end of statement block" expected).

(I have great admiration for what you've done here, by the way. And I'm very grateful you guys have actually continued this fork, as I'm sure countless others will be as well)

@williamdes williamdes added the enhancement New feature or request label Jan 1, 2021
@williamdes
Copy link
Member

(I have great admiration for what you've done here, by the way. And I'm very grateful you guys have actually continued this fork, as I'm sure countless others will be as well)

Thank you !

Well I never did see such usage, could you let us know more about what this options is intended for ?

@williamdes williamdes self-assigned this Jan 1, 2021
@Chris98
Copy link
Contributor Author

Chris98 commented Jan 1, 2021 via email

@williamdes
Copy link
Member

Thank you, this was very clear

We use https://github.com/phpmyadmin/motranslator#object-api-usage in our code base to read mo files just in case you would need this tool :)

The readme contains calls to bindtextdomain but nothing more for domains.

If you to make a pull-request this will speed up implementing this feature

@Chris98
Copy link
Contributor Author

Chris98 commented Jan 3, 2021

Thanks for the suggestion. I'm in the rather fortunate position of actually being able to run GetText natively because my host doesn't use mod_php. But that package may well help me out in terms of other projects.

I'm not that familiar with Twig's Extension markup, but I will take a look and see if I can put something together on this.

@williamdes
Copy link
Member

I also have re-wrote the tool as https://github.com/wdes/php-I18n-L10n#how-to-use because of the GPL2 license contamination effect that I did not want on my project.

You can use any of the 2 tools and it will call the native extension is available (if I am not mistaken)

@williamdes williamdes added this to the 4.0.0 milestone Feb 7, 2021
@williamdes williamdes linked a pull request Feb 13, 2021 that will close this issue
williamdes added a commit that referenced this issue Feb 13, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Member

4.0.0 is released 🚀
You can now try it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants