wp-media / plugin-family

0 stars 0 forks source link

Handle translations #11

Open wordpressfan opened 4 weeks ago

wordpressfan commented 4 weeks ago

Is your feature request related to a problem? Please describe.

Now the plugin details are not translatable because we don't use translation functions, and be generic because this package can be used in multiple plugins so different domains.

Describe the solution you'd like

I think we have two options here:

  1. Handle the translation process inside this package with its own domain.
  2. Add generic domain name here in this package and using gulp in WP Rocket plugin (or the plugin that will embed that package) we can replace this domain with the needed domain name.

Additional context

Slack discussion: https://wp-media.slack.com/archives/CUT7FLHF1/p1730270980051869

MathieuLamiot commented 4 weeks ago

Solution 2 sounds more complex to handle: I am not sure all our plugins (at group.One) use gulp and it means every plugin will need to maintain the gulp file and redo teh translations everytime.

Solution 1 seems easier technically. I don't know if we can easily setyp the new translation domain and maintain it easily too?

jeawhanlee commented 4 weeks ago

There might be a simple solution for this, I have 2 again actually

The difference between both options is that the first has fixed domains and the 2nd doesn't which makes it more flexible.

jeawhanlee commented 4 weeks ago

The solution provided might not work as expected and I think phpcs might flag an issue with it. So I might also have another simple solution, we can update the package to use translation functions but keeping the domain param as default and since we handle the dependency with mozart, meaning we have it in a custom dependencies folder, we can just pass in the domain manually and push. I think I'm with this.