cyon / vue-translation-manager

Interactively translate strings in Vue single file components
26 stars 12 forks source link

Add support for translation parameters. #5

Closed marlass closed 5 years ago

marlass commented 6 years ago

Added support for parameters in translations. Unfortunately, solution presented in issue could not be done. There is a problem with naming parameters. User could provide in each language different names and that cannot be resolved automatically. So I decided just to names these params automatically: param[$i]. With this we always provide every interpolated data to be used in translation and user can later rename them in template file to his needs.

Should close #4

MaxGfeller commented 6 years ago

Thanks a lot for the PR, @marlass!

For the parameter names: i see how this is not that simple, but i'd still refrain from generating parameter names like param1 - IMO those are not really user-friendly.

Here's my suggestion:

What do you think?

marlass commented 6 years ago

That solution make sense. I will hack on it later this week.

MaxGfeller commented 5 years ago

@marlass I took your changes and worked on them and they made it into 1.1.0. Thank you so much for your work!

I decided to use a solution quite similar to yours now, fell free to check it out.

marlass commented 5 years ago

Looks good. Thanks for finishing it and sorry for leaving it in uncompleted state. Glad it landed in new version.