Jump to content

Recommended Posts

Hello for all.

Maybe it's only me, but when I build some website in my native language (one language non-english website) I do not use/install "Language support" modules - do you do the same or it's only my wrong practice?

In that case, all my development is "fixed" (eg. can't share some scripts/code with the community, or some custom module etc.), or if I install some "frontend" module from PW repository than, also, have to install and "Language support" modules, or do ugly job (rewrite module static phrases).

Right now I found some solution (write it here) but in that case "Language Support" module installed (2 more database table, 1 template, 1 page, indexing, checking, processing etc...), but with hook addition inside "wire/core/LanguageFunctions.php" all that can be avoid.

Also in that case all PW standard translation procedures stay the same, but also we get new custom translation options (like in one-language non-english websites I will use that principle, but in multilanguage will use native and fast  PW principle).

Thanks and regards for all.

p.s. if this is a "spam" question (because write almost the same things here) then please administration to delete one of these two topics.

Link to comment
Share on other sites

  • 3 years later...

Not sure if you need this anymore and if I understand your issue properly, but this is how you can hook to get your custom translations. I use it for testing purposes in one of my modules, adding here too, perhaps somebody will find it useful.

wire()->addHookAfter('LanguageTranslator::getTranslation', function (HookEvent $event) {
    $args = $event->arguments;

    // do something here...

    $event->return = "aa";
});

 

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...