Opened 14 years ago
Closed 13 years ago
#16441 closed enhancement (fixed)
TwentyTen localization improvement
Reported by: | settle | Owned by: | 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)
Change History (16)
#2
@
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' )
#3
@
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:
↓ 5
@
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
@
14 years ago
Why should TwentyTen be different than whole WP?
It shouldn't, looks like I'm wrong..
#6
@
14 years ago
- Keywords dev-feedback removed
We're occasionally inconsistent in core, but having $date_format translated is proper.
#9
@
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.
#11
@
13 years ago
Added context in 16441.2.patch.
It is translatable -
get_the_date()
usesdate_i18n()
which handles translation of date formats. You should be able to hook into the'date_i18n'
filter to modify this.