default language and string translations

Events happening in the community are now at Drupal community events on www.drupal.org.
henrijs.seso's picture

String translation. This works differently to Drupal standard localization system: The strings will be translated from the default language (which may not be English), so changing the default language may cause all these translations to be broken.

Wouldnt the better system be that original Drupal and contrib English text strings are "neutral" and then users could add English (copy all strings from neutral, as it is already English) or Spanish (import po file or translate yourself) and switch between default languages as much as they like and all strings would be translated from "neutral"?

This system would make internationalization more consistent - by default everything would be "Language neutral" - strings, nodes, menus etc.

Is there discussion going on somewhere about this issue?

Comments

There's a number of bug

mikhailian's picture

There's a number of bug reports on the default language problem that Jose Reyero usually dismissed as non-issues.

It is clear that the status quo creates an unbelievably difficult problem for site owners on their upgrade path to D6. I stopped half-way the conversion of a fairly populated site (millions of hits/month) to multiple languages because of the default language problems and resumed just yesterday.

Im sure there is a way to

henrijs.seso's picture

Im sure there is a way to avoid clusterf**k when changing default languages and in my naive mind it looks easy, without too much blood/sweat using current system and introducing "Language neutral" for all translated strings to sync.

Basically problem is that Locale assumes all strings from core to be English when in fact they are not1, they must be treated as Language neutral. English should be added as new seperate Language in multilingual systems with possibility to copy all strings from Neutral to English.

1 Some strings are English, some are American English, some are bad English, few are English with typos :)

My proposal is fix in i18n or new module that introduces Language neutral, sets it as default, does not show it to front end users and (optionally) find other ways to provide path with no prefix for new "virtual" default language that can be ANY other language including English.

Lets discuss. Opinions welcome!

Name it Language neutral or

mikhailian's picture

Name it Language neutral or English, the problem stays the same.

AFAIU, i18n-strings just way a bit too far in trying to solve the i18n problems.

If the default language was chosen to be English for i18n-strings, it would be much easier for Drupal users to understand what is going on.

How to fix that is a different matter. I am not sure i18n is fixable as it it now. Any fix I can think of would create major upgrade problems.

source language

pasqualle's picture

Language neutral is English. Every string in every module must be written in English, it is a requirement for correct functionality.

http://api.drupal.org/api/function/t/6
Parameters
$string A string containing the English string to translate.

i18nstring is created for user submitted string translation. There are sites which don't have English language so it is logical to use the default language as source, therefore not requiring to translate any user submitted string into English..

Sure there could be a

jose reyero's picture

Sure there could be a solution for switching default language, just it seems no one has had the time to implement it yet. Patches welcomed, but whinning about it on the issue tracker just takes away time from people that maybe could do the patch otherwise.

The problem with having language-less strings is that the underlying localization system doesn't really support it. Nor D7 will do it. Moreover source strings need to have a language so you know from which language you are translating.

Thinking of English as the only default language is like saying everybody has English as one of the languages on their site. And really, the world is bigger than that...

So Drupal core handling (D6 and D7) for user defined strings is really limited. Everything you build on top of that will be limited too. We haven't got lucky with patches attempting to fix that for D7.

However most of the issues here refer mostly to UI for handling such strings. That's fixable and just needs time and work. But it eems developers posting patches have other priorities, not anybody's fault.

whinning about it on the

henrijs.seso's picture

whinning about it on the issue tracker

i follow 2 closed issues and nobody whines there, they sit silently and are sad :)

Nor D7 will do it.

Even sadder :)

source strings need to have a language so you know from which language you are translating.

Not necessarily. I dont care what is language of source strings, most of the time they will be english anyway.

the core issue is that switching default languages will fck up translated strings. That is massive fail. How about we think for a moment what is the less painful way to fix it.

I had an idea yesterday, what if developer needs web site in french and russian, but wants to work/synchronize content in english. So he installs drupal with english default + fr and ru languages. He wants users to see french as default and be able to switch to russian, but default english is hidden.

the idea would be that he NEVER EVER switches default language, its english forever (not to kill translated strings). default french for front end is set in apache config or (...your suggestion here), like something.com = something.com/fr

is it possible to switch to russian in this apache setup?

is this issue dead?

henrijs.seso's picture

returning to original posts

The strings will be translated from the default language (which may not be English), so changing the default language may cause all these translations to be broken.

Why exactly this happens?

don't hope so

guedressel's picture

Hi there!
I am with mansspams. Even though my point is somehow different:
I just don't want to have the functionality of t() or i18n lost if i view a drupal page in english.
By using i18n (and t()) I'm able to switch default text outputs of modules the way I want it. It's really handy. Not only in terms of translation but also in terms of modifying texts to my needs. May I want to have a certain module to spit out a different text at a certain place - I can do that nicely by using i18n - as long as I'm not trying to change english texts :(

So many systems are using gettext functionality to change outputs generally...
...why not drupal too?
I'm getting sick of jumping in each modules source code to change the english texts and get them lost in the next upgrade of the same module.

Cheers to mansspams.
And the problem lays even deeper in my eyes.

translating to English

pasqualle's picture

@guedressel: add a new language and name it English. Do never modify the source code.

I really wanna know the

dan.hu's picture

I really wanna know the solution. I am driven crazy by this.

Same for me! The t() string

passa's picture

Same for me!

The t() string should not be a langage string but just a key!

We don't care if it's write en English, French, Russian or other. It's the developper choice.

But optimal will be to put a key in the t() function, and link translation to this key ....

The current i18n gestion looks prehistorical for me...


Make your shopping easier: http://www.ookoodoo.com

t()string / i18n obsolete ?, need unique key per message ?

orfils's picture

Yes and no, it was a big debate 25 years ago around taxonomy , based on facet number.
The facet was considered as obsolete and replace by more meaningfull "words" with all related problems already mentioned and at the end a "context/parent" relation were added.

Then with open source i18n and related utilities (po, pot files) wins based on the fact that all initial and more used version will be the initial english one.

I did not feel me confident that I of even drupal community will change all that quickly but it is obvious that some "neutral" or "abstract" structured is needed.

And that's go more in the way to have a initial "neutral" <english!> language with message "as in the initial code"(module ...) and considered all other language including good english at the same level.

In case of module update with change in the initial message some alias system could be look at.

Pierre Orfinger
Schaveyslaan 34
1650 BEERSEL
Belgium
pierre@orfinger.be
+32 475443959

Related issue

frank ralf's picture

Just want to relate this thread to the recent discussion on Using Key instead of "natural language" for translation.

Frank

hey, guys. i just came up

dan.hu's picture

hey, guys. i just came up with a solution to this problem. which is:

  1. at /admin/settings/language/, keep the default language to English.
  2. edit the language "English". leave empty for path prefix and enter "http://en.you-domain.com" for the language domain.
  3. edit the language that you wish to set to default. leave empty for path prefix and enter "http://www.your-domain.com" for the language domain.
  4. at /admin/settings/language/configure, choose "Domain only" for language negotiation.

now when the user visits http://www.your-domain.com, your preferred language will show up and English is still the "default" language.

I'm using the "create a new

macramole's picture

I'm using the "create a new english language" solution, but I'm having this problem: Content translation is showing inactive languages anyone else ?

Solution

matej kollar's picture

As I really needed to solve above commented issue for my project, I have implemented the following hacks to Drupal core:

  1. To hide English from the language switcher:
    As the default language prefix is not mandatory, I omitted the language without prefix from the locale module block.
    See locale_block() in attached locade.module.

  2. To keep English as language for t() but to have some other language as default for the site, I implemented language_default_hack()
    function and used it instead of the language_default() in language.inc. My language_default_hack() function gets the languages and
    determines the first one without prefix as the default one.

Attached files have txt extension to be able to attach them here.

All the best,
Matej

I have come across this issue

YK85's picture

I have come across this issue and googling to find an answer.
I came across this thread but it looks like there is no easy fix for this at the moment?

I solved this by

ali asif's picture

1- at /admin/settings/language/, change default language to danish(or any other then english).
2-edit the language "English". enter en in prefix.
3-Save and Test

Thanks to dan.hu for guiding to the solution

Ya I agree with this

jnavane's picture

This is working for me

Best solution

I'd like to know the status

dan.hu's picture

I'd like to know the status of this issue from the maintaining team. Thank you.

This problem has just bitten

Ashraf Amayreh's picture

This problem has just bitten me. My question is, why not ask the user, when switching the default language, what language to choose for input? Or maybe just add a totally separate choice in the language screen asking what language to consider the input language?

Let's say I've added all these terms in English and switched the default language to Ar, it just doesn't make sense to consider everything I've input to date in Ar (and tell the client to go and start modifying all these terms because the default language changed!).

I don't know much about this coding and database wise, but it seems the only problem now is that input language is always assumed to be the default language. I'm guessing there's more to it than this database wise, and would be very very glad if someone explained the scene in the backend.

All feedback on this is more than welcome. And if I can really understand what's going on here I'm more than prepared to submit patches to i18n or core. Just need someone to put me on the right track.

There's now a setting (for

jose reyero's picture

There's now a setting (for i18n D7) that allows you to select a different 'Source language' for strings (different of default language).

String Translation source language

kristen pol's picture

Going through old posts... for those who are happening upon this, in Drupal 7, the String Translation source language can be set at:

Configuration » Regional and language » Multilingual settings » Strings

Cheers,
Kristen

Thank you

grinxols's picture

Thanks for sharing this, I didn't knew!!! I'm enjoying string translations in my website now :D

Internationalization

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: