Post date time language change?

Post Reply
mahmut
Ssr. Bludit
Posts: 28
Joined: Fri Feb 12, 2016 2:27 pm

Fri Mar 25, 2016 2:57 pm

Hello , he writes in English when I add content to date . I want to appear in Turkish. Could you help? Thank you.

Image

English: March 25, 2016
Turkish: Mart 25 2016

Thanks.
User avatar
Edi
Site Admin
Posts: 1166
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Fri Mar 25, 2016 9:06 pm

It's on the to do list.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
User avatar
Edi
Site Admin
Posts: 1166
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Fri Mar 25, 2016 10:15 pm

As a hack, till it is done (the core has to be changed), you can exchange the following in the files home.php (line 14) and posts.php (line 12) of the theme (in /bl-themes/future-imperfect/php):

Code: Select all

	
		<div class="meta">
	                <?php
                	// Get the user who created the post.
	                	$User = $Post->user();

	                	// Default author is the username.
	                	$author = $User->username();

	                	// If the user complete the first name or last name this will be the author.
				if( Text::isNotEmpty($User->firstName()) || Text::isNotEmpty($User->lastName()) ) {
					$author = $User->firstName().' '.$User->lastName();

				// Local month
				$nmeng = array('January','February','March','April','May','June','July','August','September','October','November','December');
				$nmger = array('Januar','Februar','M&auml;rz','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember');
				$dt = $Post->date();
				$dt = str_ireplace($nmeng, $nmger, $dt);
				}
			?>
			<time class="published" datetime="2015-11-01"><?php echo $dt ?></time>
			<div class="author"><span class="name"><?php echo $author ?></span><img src="<?php echo $User->profilePicture() ?>" alt=""></div>
</div>
This is for the German translation. You have to edit the string:

Code: Select all

$nmger = array('Januar','Februar','M&auml;rz','April,'Mai','Juni','Juli','August','September','Oktober','November','Dezember');
Last edited by Edi on Wed Aug 03, 2016 12:56 am, edited 5 times in total.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
mahmut
Ssr. Bludit
Posts: 28
Joined: Fri Feb 12, 2016 2:27 pm

Sat Mar 26, 2016 10:05 am

Thank you very much , the problem was solved .
Timsalabim
Jr. Bludit
Posts: 1
Joined: Mon Aug 01, 2016 3:30 pm

Mon Aug 01, 2016 3:36 pm

Sorry but in my case I get an error:

Notice: Undefined variable: dt in C:\xampp\htdocs\basic4kids\bl-themes\future-imperfect\php\home.php on line 38

I use the same theme.

And there is a typo in the line $nmger. There is a ' missing after April.

Kind regards,
Tim
User avatar
Edi
Site Admin
Posts: 1166
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Wed Aug 03, 2016 12:56 am

Timsalabim wrote: Notice: Undefined variable: dt in C:\xampp\htdocs\basic4kids\bl-themes\future-imperfect\php\home.php on line 38
I have again to try to install xampp... Never worked on my PC. ;-)
And there is a typo in the line $nmger. There is a ' missing after April.
Thank you! I fixed it in my post.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
User avatar
Torsten_Kelsch
Master Bludit
Posts: 140
Joined: Thu Aug 27, 2015 10:24 pm
Location: Germany
Contact:

Wed May 31, 2017 3:46 pm

Thank you, your solution works fine. But in Bludit 1.6.1, the translation of the date has not been added to the kernel yet, as far as I can see.
ON ERROR GOTO BED
User avatar
Edi
Site Admin
Posts: 1166
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Wed May 31, 2017 8:15 pm

What do you mean with "the translation of the date has not been added to the kernel yet"?

The hack adds the translation. And: There are no translations in the kernel, for translations language files are used.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
User avatar
Torsten_Kelsch
Master Bludit
Posts: 140
Joined: Thu Aug 27, 2015 10:24 pm
Location: Germany
Contact:

Wed May 31, 2017 9:12 pm

You wrote:
As a hack, till it is done (the core has to be changed), you can exchange the following in the files home.php (line 14) and posts.php (line 12) of the theme (in /bl-themes/future-imperfect/php):
This tells me it might have been planned to make it a core functionality (additionaly using a language file, of course).
ON ERROR GOTO BED
User avatar
Edi
Site Admin
Posts: 1166
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Wed May 31, 2017 11:52 pm

I don't know, what Diego plans. It's on the wishlist... This is all I know. ;-)
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Post Reply