Fix language picker if there is only one language

claudiu.cristea - March 9, 2008 - 12:05
Project:Localization server
Version:5.x-1.0-alpha3
Component:User interface
Category:feature request
Priority:normal
Assigned:claudiu.cristea
Status:closed
Description

How can I limit the server to only one language? I plan to setup a country-based l10n server and I don't need only one language...

Or how can I delete the other languages or prevent them appearing on "Pick a language" dropdown (on translate page) or on translate/languages page?

#1

zirvap - March 9, 2008 - 20:56
Status:active» fixed

You go to admin/settings/locale/language/add and add the language(s) you want to translate. Only the languages you add will show up on the translate pages.

(I'm setting this issue to "fixed" -- if my answer didn't solve your problem, please set it to "active" again.)

#2

claudiu.cristea - March 11, 2008 - 13:42
Title:Limit languages» Fix language picker if there is only one language
Version:5.x-1.x-dev» 5.x-1.0-alpha3
Component:Miscellaneous» User interface
Category:support request» feature request
Assigned to:Anonymous» claudiu.cristea
Status:fixed» patch (code needs review)

Well... finally I found that when l10_dupalorg is installed the locales_meta table is filled up with all languages known by Drupal... I think that this must be an administrator's task in the future. He must be able to add/remove languages from l10n_server. But this could be a subject to another patch...

I changed the name of the issue and I made a patch to handle the case when there is only one language. In that special case we don't need any radio or dropdown box for language choosing.

TODO:

  1. Redirect the page translate/projects/<project_name> directly to translate/languages/<unique_language>/view?project=<project_name>
  2. Redirect the page translate/languages directly to translate/languages/<unique_language>

... when there is only <unique_language> defined.

AttachmentSize
welcome.inc_.patch1.98 KB

#3

claudiu.cristea - March 11, 2008 - 12:40

Patched TODO 2 from #2.

AttachmentSize
l10n_community.patch2.78 KB

#4

claudiu.cristea - March 11, 2008 - 13:44

And, finally, TODO 1 from #2. The attached patch contain all changes...

AttachmentSize
l10n_community.patch3.22 KB

#5

brmassa - April 2, 2008 - 18:45
Status:patch (code needs review)» patch (reviewed & tested by the community)

Claudiu,

nice patches. working.

Very useful while its not on drupal.org.

regards,

massa

#6

Gábor Hojtsy - April 25, 2008 - 18:35
Status:patch (reviewed & tested by the community)» fixed

claudiu.cristea: I have committed a slightly modified (commented, code style improved) version of your first patch.

The reason is that I do not share your view that people should be redirected from the language overview and project summary pages. The language overview provides a status overview of any language set up, and this information is not available anywhere else on the site, so if we redirect people from there, then we make this information inaccessible. The same applies to the project summary page, which lists project information not available anywhere else.

Thanks for the patch!

#7

Anonymous (not verified) - May 9, 2008 - 18:42
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.