Closed (fixed)
Project:
Custom Language field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2013 at 10:51 UTC
Updated:
19 Nov 2015 at 11:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
guillaumev commentedAs a temporary solution, I did this (see patch attached) but it is not a real solution...
Comment #2
johnvThe language field offers an option 'all installed languages'. You should be able to create the language Dari using core/locale under 'Regional settings' (even if it is not in the list, if this is not possible, it is a core/locale issue). You can then disable the language, to prevent any users setting this language in his/her account. But using the options, the Dari languge is in the language field.
Comment #3
guillaumev commentedThanks, but then it means that I would also need to create languages for all of the other languages I want to provide an option for. Would there be a way to do a "mix" of the predefined languages and the installed languages ?
Comment #4
johnvSorry, languagefield does not provide an option by itself to add/create new languages.
Comment #5
shaneonabike commentedUnfortunately, that doesn't really work as you suggested. Mainly, because if I select the list of pre-defined cause I want to supply those for a list of Artists say... then it only uses those and doesn't include any new regional ones I added. I just tried this today and it didn't work properly :( Is there not an option to add a checkbox to add additional ones that have been added by hand perhaps?
Comment #6
johnvSo this would mean to change the first radio button in "Field settings - Enabled Languages" from 'All Predefined languages' to 'All Predefined and installed languages'?
Comment #8
johnvAdjacent patch converts the single-value radiobutton in the field settings to multi-value language set.
Now you can choose predefined languages AND custom languages.
Comment #10
johnvComment #14
guillaumev commentedActually I'm reopening this, because adding Dari as a custom language in the Drupal interface doesn't work for me. Doing this adds Dari as a language EVERYWHERE (even when disabled), so that nodes and content can be translated to Dari, which is not something I want (I want Dari to appear ONLY in the language fields). I therefore created a patch for languagefield, which adds a hook_alter to the _languagefield_options function, allowing developers to alter the list of languages in other modules.
Comment #15
johnv@guillaume, this seems like a regression error in D7 core. (In D8, the 'disabled languages' do not exist anymore.)
You should not be able to translate into disabled languages. Did you test with Languagefield disabled? Please add an issue in the core language.module issue queue?
Comment #16
johnv@guillaumev : Hmm, I cannot reproduce this: Addinga custom language, and disabling it after that, I cannot choose in in E.g. the user language.