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

Translation #6

Open
jbonlinea opened this issue Feb 7, 2021 · 9 comments
Open

Translation #6

jbonlinea opened this issue Feb 7, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@jbonlinea
Copy link

Hi,

I'm on the way to use this plug-in and consider translating it to french, however language/civicrm-ux.pot is empty so I wonder what are the chains that may be translatable ?

Regards

@agileware-justin
Copy link
Contributor

@jbonlinea no idea sorry, will happily accept your efforts to implement translation for this plugin.

@jbonlinea
Copy link
Author

Hi,

One question. Where do the text actually displayed by the shortcodes (let's narrow it to the member shortcode) comes from ?
Your plug-in or straight from Civi ?

I mean do your plug-in has any text or string that are displayed on the front end, or 100% of what is displayed comes from Civi strings ?

Knowing this will help to figure what could be translated and where from.

Regards

@agileware-justin
Copy link
Contributor

@christianwach
Copy link
Contributor

@agileware-justin I think @jbonlinea means that the plugin's .pot file is empty and therefore no .po and .mo files can be generated and stored outside the plugin's directory in the alternative places that WordPress provides. It's a good idea to regenerate the .pot file every time a new version of the plugin is tagged.

@christianwach
Copy link
Contributor

@agileware-justin There are two ways this can be done:

@agileware-justin agileware-justin added the enhancement New feature or request label Mar 19, 2021
@agileware-justin
Copy link
Contributor

We will happily accept any PRs / submissions to set up translation for this plugin.

@jbonlinea
Copy link
Author

Hi,

Well I meant two thing, one like @christianwach outlines above, and the other is what part of the "text/data" displayed by the shortcode is comming from civicrm and what could be translated in a .po file ?

for instance [ux_membership_type] : returns exactly the civi membership type label, while [ux_membership_expiry] return "Your membership expires on décembre 31st, 2021". On this second example is "Your membership expires on" comming from your plug-in and "décembre 31st, 2021" from civi, or your plug iget the the expiry date from civi and format it berore placing it into the whole string ?
I also need to know that to tackle a translation (especially since different countries have different standard to display date and such). With pot file I could indeed look for the string and get it myself :)

I won't address this at right now as there are more critical things to address first, and I'm know thinking that one could get the value with the data processor and format it or place it in a phrase as he wants so there may already be a working and flexible solution for all :)

@christianwach
Copy link
Contributor

christianwach commented Mar 22, 2021

@jbonlinea Unfortunately, that string isn't translatable at all because it's hard-coded in the plugin. The code should read:

$membership_summary_message .= '<div>' . sprintf( __( '%1$s member - %2$s. Your membership expires on %3$s', 'civicrm-ux' ), $membership_types, $membership_summary_status, $end_date_format ) . '</div><div>' . '<a href="' . esc_url( $summary_show_renewal_URL ) . '">' . __( 'Click here to renew your membership', 'civicrm-ux' ) . '</a></div>';

You're going to have to apply the same kinds of changes to all the text in this plugin in order to translate it into French.

@jbonlinea
Copy link
Author

You're going to have to apply the same kinds of changes to all the text in this plugin in order to translate it into French.

Yeah, well the point was to have translations to used both french and english ; and I could have provided the french translations at least, and eventually a couple others with some quick review.

English will do for the time being

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

No branches or pull requests

3 participants