Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#16441 closed enhancement (fixed)

TwentyTen localization improvement

Reported by: settle's profile settle Owned by: ryan's profile ryan
Milestone: 3.3 Priority: normal
Severity: trivial Version: 3.1
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

archive.php

<?php if ( is_day() ) : ?>
				<?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?>
<?php elseif ( is_month() ) : ?>
				<?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( 'F Y' ) ); ?>
<?php elseif ( is_year() ) : ?>
				<?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( 'Y' ) ); ?>
<?php else : ?>
				<?php _e( 'Blog Archives', 'twentyten' ); ?>
<?php endif; ?>

Please, make the string ( 'F Y' ) translatable. For example, in lithuanian we use ( 'Y F' ). So we currently have to manually edit archive.php.

And I think that day archive format and year archive format should also be translatable, just in case. Maybe it should look different in some languages.

Attachments (4)

16441.diff (783 bytes) - added by solarissmoke 14 years ago.
archive.diff (878 bytes) - added by settle 14 years ago.
My suggestion. Works fine in my localhost.
16441.patch (2.0 KB) - added by SergeyBiryukov 13 years ago.
16441.2.patch (2.2 KB) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (16)

#1 @solarissmoke
14 years ago

  • Keywords close added; TwentyTen removed

It is translatable - get_the_date() uses date_i18n() which handles translation of date formats. You should be able to hook into the 'date_i18n' filter to modify this.

#2 @settle
14 years ago

Yes, get_the_date() is translatable, but get_the_date( 'F Y' ) is static and not included in TwentyTen.pot
I am not able to choose between F Y and Y F.

In other themes I can find something like this:

printf( __('Archive for %1$s', 'inove'), get_the_time(__('F jS, Y', 'inove')) );

Now, date expression is included in theme translation file.

p.s. I am only translating, I have no knowledge in coding, so hooking and other words say nothing to me, sorry. I am only asking to use
get_the_time(('F Y', 'twentyten'))
instead of
get_the_date( 'F Y' )

Version 0, edited 14 years ago by settle (next)

#3 @solarissmoke
14 years ago

  • Keywords dev-feedback added; close removed

The problem is that 'F Y' is not an English language string, but a PHP date format specifier. I'm fairly certain that hooking into date_i18n is the proper way to handle this, but lets see what the senior devs say.

#4 follow-up: @settle
14 years ago

Yes, it is not an English string, but everywhere in WP it is translatable string.

For example: /wp-includes/theme-compat/sidebar.php:35

			<p><?php printf(__('You are currently browsing the <a href="%1$s/">%2$s</a> blog archives for the day %3$s.'), get_bloginfo('url'), get_bloginfo('name'), get_the_time(__('l, F jS, Y'))); ?></p>

Why should TwentyTen be different than whole WP?

#5 in reply to: ↑ 4 @solarissmoke
14 years ago

Why should TwentyTen be different than whole WP?

It shouldn't, looks like I'm wrong..

#6 @nacin
14 years ago

  • Keywords dev-feedback removed

We're occasionally inconsistent in core, but having $date_format translated is proper.

#7 @solarissmoke
14 years ago

  • Keywords has-patch added

@solarissmoke
14 years ago

@settle
14 years ago

My suggestion. Works fine in my localhost.

#8 @dd32
13 years ago

  • Component changed from Themes to Bundled Theme

#9 @SergeyBiryukov
13 years ago

  • Milestone changed from Awaiting Review to 3.3

16441.patch makes the requested strings translatable in Twenty Eleven as well.

In Kubrick, they were translatable too.

#10 @nacin
13 years ago

These should probably have a translator comment or context.

#12 @ryan
13 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [19241]:

Make date formats for transation. Props SergeyBiryukov, settle. fixes #16441

Note: See TracTickets for help on using tickets.