Hey there,
Are you using Codestyle Localization?
https://wpjobmanager.com/document/translating-wp-job-manager/
These strings are there and you should have no issues finding them in the ‘wp-job-manager’ text domain following those instructions.
Remember that some strings will appear as “Posted %s ago” for dates.
Hope this helps,
Scott
Hey there thanks! I found out my plugin had 144 untranslated strings.
Question: the %s.. How do I translate that?
There are many “%s” in my MO file. Do I just replace %s with Maanden/Months?
Like.. Posted %s ago has been changed to “Geplaatst: %s geleden” so the “s” stands for month/months. How will it know when to change to Months instead of month after it’s been 2 “MONTHS” ago?
Also,
“Choose a category” is nowhere to be seen.
Just found out “%s” creates the text: 1 Month
How can I change Month to Maand?
You’ll want to keep %s as this is replaced with other strings like (Day(s), Month(s)).
You can also find these as standalone strings which you should be able to translate and they’ll be used throughout the plugin.
Hey there,
Thanks for the reply, Ok so I keep %s..
I have searched for “month” and “day” everywhere.. but they are not in the plugin translation mo file.
I also checked if WordPress itself had them said to the desired translation which it has. It just does not set it for the plugin.
If you don’t mind, can you tell me where to find where to change day and month? After that I should be all done π
Thanks again,
We output time difference using http://codex.wordpress.org/Function_Reference/human_time_diff, so you’d need to translate WordPress itself as thats where the ‘month’ string will be.
hey there,
Thanks for the message, I already have that, see: here
So im still clueless..
And see: here
I also have my installation set to dutch: $table_prefix = ‘wp_nl’;
Got it, worked! edited formatting.php file and added:
/* translators: min=minute */
$since = sprintf( _n( '%s minuut', '%s minuten', $mins ), $mins );
} elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) {
$hours = round( $diff / HOUR_IN_SECONDS );
if ( $hours <= 1 )
$hours = 1;
$since = sprintf( _n( '%s uur', '%s uur', $hours ), $hours );
} elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) {
$days = round( $diff / DAY_IN_SECONDS );
if ( $days <= 1 )
$days = 1;
$since = sprintf( _n( '%s dag', '%s dagen', $days ), $days );
} elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
$weeks = round( $diff / WEEK_IN_SECONDS );
if ( $weeks <= 1 )
$weeks = 1;
$since = sprintf( _n( '%s week', '%s weken', $weeks ), $weeks );
} elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) {
$months = round( $diff / ( 30 * DAY_IN_SECONDS ) );
if ( $months <= 1 )
$months = 1;
$since = sprintf( _n( '%s maand', '%s maanden', $months ), $months );
} elseif ( $diff >= YEAR_IN_SECONDS ) {
$years = round( $diff / YEAR_IN_SECONDS );
if ( $years <= 1 )
$years = 1;
$since = sprintf( _n( '%s year', '%s years', $years ), $years );
}
Nice! Happy to see you got this working π
Cheers,
Scott
This thread is now be marked as [RESOLVED]