• Resolved Marc2412

    (@marc2412)


    Hey there,

    This is my website job page: here

    It’s in dutch. The two things I want translated are “choose a category” and “date posted” which says “1 month ago” and when you click on the job at the top it says “Posted 1 month ago”.

    I have tried opening the MO files but there is no translation for those 2 strings.

    Please help me out on this matter.

    Kind Regards,

    https://wordpress.org/plugins/wp-job-manager/

Viewing 14 replies - 1 through 14 (of 14 total)
  • 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

    Thread Starter Marc2412

    (@marc2412)

    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?

    Thread Starter Marc2412

    (@marc2412)

    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.

    Thread Starter Marc2412

    (@marc2412)

    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.

    Thread Starter Marc2412

    (@marc2412)

    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,

    Thread Starter Marc2412

    (@marc2412)

    Im desperate to know :/

    Plugin Author Mike Jolley

    (@mikejolley)

    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.

    Thread Starter Marc2412

    (@marc2412)

    hey there,

    Thanks for the message, I already have that, see: here

    So im still clueless..

    Thread Starter Marc2412

    (@marc2412)

    And see: here

    I also have my installation set to dutch: $table_prefix = ‘wp_nl’;

    Thread Starter Marc2412

    (@marc2412)

    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

    Thread Starter Marc2412

    (@marc2412)

    This thread is now be marked as [RESOLVED]

    Thread Starter Marc2412

    (@marc2412)

    .

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Translating problem’ is closed to new replies.