GravityKit / GravityExport-Lite

GravityExport Lite. Export all Gravity Forms entries to Excel (.xlsx) via a secret (shareable) url.
https://gfexcel.com
GNU General Public License v2.0
12 stars 8 forks source link

Translation functions to the standard translation functions. #57

Closed Liblastic closed 4 years ago

Liblastic commented 4 years ago

Hello, I need to add translations for the plugin. I'm using Poedit to scanning the translations. The plugin is using custom functions translate() to populate translation functions. I can scan translate() function strings if string is inside function by adding custom source keyword translate to the Poedit.

But this line 878 isn't possible to scan with Poedit. I would recommend to use standard WordPress functions __(), _x() to translate the strings. Or can you tell me how you are maintaining the translations, thanks!

https://github.com/doekenorg/gf-entries-in-excel/blob/cdbd9da0fac41052940eca3531cb2f8877533dc6/src/GFExcelAdmin.php#L878

doekenorg commented 4 years ago

I maintain the nl_NL version myself. So that is up to date. I'd just copy that one and provide the translations.

Awesome by the way you want to help!

doekenorg commented 4 years ago

By the way. You are completely right about the translate function. I've only recently bought Poedit and found out the same issue. Going to think about a solution that works with that, because I want to start using Poedit more :-)

doekenorg commented 4 years ago

Closed due to inactivity.

Liblastic commented 4 years ago

How about this issue. Are you going to refactor translate() function calls to the standard __() functions? This is a breaking feature for the default translation methods. You should be safe if you just refactor all the custom translate functions to the standard with text domain __( 'string', 'plugin-text-domain' );.

Note that you couldn't use variable names for the __() parameters because the parser won't be able to handle them correctly.

I hope this helps you.

doekenorg commented 4 years ago

I think you are right. If you want you can send me a PR and i'll see if I can merge it in the next release.

Liblastic commented 4 years ago

@doekenorg Do you have any status update for this? I need Finnish translations for my customer. :)

doekenorg commented 4 years ago

@Liblastic I think the easiest thing to do is release the translation in the next release, and not wait for the next release. Because then I need to release another version only to include the translations. I have 1 feature left for the release of 1.8.0. If I finish that, I'll give you a heads up. From that point you can checkout the develop branch, and translate everything in the plugin. You can then send me a PR. I'll merge that in, and I can release 1.8.0 including your translation.

doekenorg commented 4 years ago

@Liblastic I've just pushed the last change to develop including all the new translations for dutch. To send me a PR:

  1. Fork this repo
  2. Clone it to your local machine
  3. Checkout develop
  4. Add a new feature branch from develop
  5. Run Poedit and add the necessary translations
  6. Add the files, and commit. Push the feature branch to your repo.
  7. Open a PR to the develop branch of this repo.

After that I'll merge it, finish up for the master and release 1.8.0 including your translations.

doekenorg commented 4 years ago

Hello, I need to add translations for the plugin. I'm using Poedit to scanning the translations. The plugin is using custom functions translate() to populate translation functions. I can scan translate() function strings if string is inside function by adding custom source keyword translate to the Poedit.

But this line 878 isn't possible to scan with Poedit. I would recommend to use standard WordPress functions __(), _x() to translate the strings. Or can you tell me how you are maintaining the translations, thanks!

https://github.com/doekenorg/gf-entries-in-excel/blob/cdbd9da0fac41052940eca3531cb2f8877533dc6/src/GFExcelAdmin.php#L878

I fixed this too by the way. Just not in all places, because i only need it once to be able to translate it.

doekenorg commented 4 years ago

@Liblastic I want to release the new version soon. Can you give me an estimate when you can send in the translations?

doekenorg commented 4 years ago

Closed due to inactivity. Translations will have to come later.