Opened 2 years ago
Closed 19 months ago
#16441 closed enhancement (fixed)
TwentyTen localization improvement
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.3 |
| Component: | Bundled Theme | Version: | 3.1 |
| Severity: | trivial | Keywords: | has-patch |
| 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)
comment:1
solarissmoke — 2 years ago
- Keywords close added; TwentyTen removed
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' )
comment:3
solarissmoke — 2 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.
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?
comment:5
in reply to:
↑ 4
solarissmoke — 2 years ago
Why should TwentyTen be different than whole WP?
It shouldn't, looks like I'm wrong..
- Keywords dev-feedback removed
We're occasionally inconsistent in core, but having $date_format translated is proper.
comment:7
solarissmoke — 2 years ago
- Keywords has-patch added
solarissmoke — 2 years ago
SergeyBiryukov — 20 months ago
comment:9
SergeyBiryukov — 20 months 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.
comment:10
nacin — 20 months ago
These should probably have a translator comment or context.
SergeyBiryukov — 20 months ago
Added context in 16441.2.patch.
comment:12
ryan — 19 months ago
- Owner set to ryan
- Resolution set to fixed
- Status changed from new to closed
In [19241]:

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.