Change original Post Type string

This topic contains 24 replies, has 4 voices, and was last updated by  Birgit Wilde 6 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #433108

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #433126

    Birgit Wilde
    Full Member
    Post count: 236
    This reply has been marked as private.
    #433135

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #433204

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #433363

    Birgit Wilde
    Full Member
    Post count: 236

    Hi Kiran,
    thanks very much. I found the strings in WPML. However, this does not seem to solve my problem.
    In WPML I have set the language of all domains to German – because German is the default language of my website.

    As you can see on the first screenshot, the string translation now shows the AM/PM in the German string, which I cannot change but only translate into Englisch.

    So when I switch the language of the domain geodirevents into English, I can translate the AM/PM into German “Uhr), as you can see on the second screenshot.

    Still this translation will not be shown on my website, I guess because the default language of my site is German.

    How can I solve this?!

    #433370

    Birgit Wilde
    Full Member
    Post count: 236

    Hi Kiran,
    and this actually brings me to two general questions I have regarding wpml string translation:

    1) In wpml I translate an English string into German and then change the domain language from English to German. Why does this very same string, now in German, still show the English words, although I have just provided the German translation?

    2) Does the wpml string translation in any way synchronize with the po/mo-files on my server (which I would assume)?

    Because I upload the entirely translated po/mo-files of any domain on my server – everything is fine in the frontend so it obviously is the correct file in the correct folder. Still the wpml string translation keeps on telling me, that none of the strings is translated.

    See attached screenshots:
    1. Translated string in the geodirevents-de_DE.po
    2. WPML string translation of that very same string AFTER upload of the po and mo on my server.

    Or do I generally misunderstand how that string translation should work? Should that be the case, please let me know!

    #433482

    Kiran
    Moderator
    Post count: 7069

    Hello Birgit,

    Here the default strings AM/PM are in English and we are translating it into German, so source language should be English for those string.

    I have checked with changing source language to English and it worked fine.
    Source language should be the language in which the string bu default.

    To know more about string translation please check documentation by WPML team or contact them. 🙂

    Kiran

    #433656

    Birgit Wilde
    Full Member
    Post count: 236

    Hi Kiran,

    great thanks. Now the “Uhr” is also visible with my Browser (maybe that was a browser cookie-thing).

    If now there would be a way to also fix the date and time itself in the Add Event form as shown in the screenshot “add event form”, I would be completely happy.

    The date I already have set in the event settings (see screenshot “event date settings”) – but it doesn’t seem to show properly in the Add Event form.

    And the time has to count from 0 until 24 (otherwise Germans will not be able to differ between morning and afternoon).

    I already have translated all date- and time-related strings I could find but nothing helped.

    Thank you so much for all your time, patience, input and effort!
    Birgit

    #433714

    Kiran
    Moderator
    Post count: 7069

    Hello,

    The date I already have set in the event settings (see screenshot “event date settings”) – but it doesn’t seem to show properly in the Add Event form.

    The date format setting you marked with yellow color is used for display purpose. To set date format in input field select it from first dropdown (Event Hinjufuzen).

    And the time has to count from 0 until 24 (otherwise Germans will not be able to differ between morning and afternoon).

    By default it shows in 12-hour format, but you can manage it via hook.
    Use following code snippet to show in 24-hour format.

    
    
    function _gd_custom_times_24_hours_format( $times = array() ) {
    	$time_increment = apply_filters('geodir_event_time_increment' , 15) ;
    	$event_time_array =array();
    
    	$am = __( '%s AM', 'geodirevents' );
    	$pm = __( '%s PM', 'geodirevents' );
    
    	for($i=0;$i<24 ; $i++ ) {
    		 for($j=0 ; $j < 60 ; $j+= $time_increment ) {
    		 	$time_hr_abs = $i ;
    		 	$time_am_pm = $am;	
    		 	if($time_hr_abs<10)
    				$time_hr = '0' . $time_hr_abs ;
    			else
    				$time_hr =  $time_hr_abs ;
    			if($j<10)
    				$time_min = '0' . $j ;
    			else
    				$time_min =  $j ;
    			if($i<10)
    				$time_hr_index = '0' . $i ;
    			else
    				$time_hr_index = $i ;
    			
    		 	$event_time_array[ $time_hr_index  . ":" . $time_min ] = wp_sprintf( $time_am_pm, $time_hr . ":" . $time_min );
    		 }
    	}
    	return $event_time_array;
    }
    add_filter( 'geodir_event_schedule_times', '_gd_custom_times_24_hours_format', 10, 1 );

    Thanks,
    Kiran

    #433859

    Birgit Wilde
    Full Member
    Post count: 236

    Wow, so many rows to count from 1 – 24 … 😉
    Excellent, it works!
    Many thanks, Kiran!

Viewing 10 posts - 16 through 25 (of 25 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount