Hi,
Here is an ultra-simple patch to i18n.inc to make the country lists display localized names and alt tag.
I don't see why this wasn't done already.

-J

CommentFileSizeAuthor
#5 patch_304.38 KBastroman
#4 patch_294.32 KBastroman
#3 patch_284.34 KBastroman
i18n.inc_5.patch551 bytesastroman

Comments

jose reyero’s picture

Status: Needs review » Closed (won't fix)

I think it makes more sense to show each language native name.

astroman’s picture

Yes, you're quite right. Obvious, really. I am putting a patch together that does this.

astroman’s picture

Title: display localized names and alt tags » display native names and alt tags
Status: Closed (won't fix) » Active
StatusFileSize
new4.34 KB

So I changed the title beacuse it's actially native names and alt tags that we want.

I changed the t($string, $args = 0) and locale($string) functions from common.inc and locale.module to accept an additional $lang argument to translate to a language other than $locale, and called this from i18n.inc with the corresponding language.

astroman’s picture

StatusFileSize
new4.32 KB

That version was buggy - error with cache refreshing. Apologies.

astroman’s picture

StatusFileSize
new4.38 KB

Apologies - fixed another error with cache refreshing - needed to track the language of the cached translations stored in the static var $locale_t.

In this implementation, the translation cache is refetched with cache_get if the language has changed since the previous translation. What are the perfomance consequences of doing this? Should we keep the cache for each language once it has been fetched?

-J

jose reyero’s picture

Version: 4.6.x-1.x-dev » master
Category: bug » feature
Status: Active » Needs work

This is still "won't fix" for 4.6. It's such a complex patch for this simple feature...

However I'd consider it for inclusion in v4.7 if you get rid of core patches, and provide some i18n replacement for locale's t() function, which could be an interesting addition for i18n api.

Thanks,

jose reyero’s picture

Status: Needs work » Closed (fixed)

This doesn't make sense anymore, the issue has been fixed for latest versions