Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291195

Unable to create languages with empty prefix

$
0
0

https://api.drupal.org/api/drupal/includes!locale.inc/function/locale_add_language/7

See also: https://drupal.org/node/1679096

locale_add_language('en-CA', 'English (Canada)', 'English (Canada)', LANGUAGE_LTR, '', '', true, true);

Expected result: Add a new language, and set it as default, with an empty prefix
Actual result: Adds a new language, but, since $prefix is tested using empty() instead of === NULL, the new language gets $langcode set as its prefix.

1. local_add_language()'s signature should be changed to have $prefix = NULL
2. $prefix should only be set to $langcode when it is literally NULL

Request for comments: what are your foreseeable good/bad consequences with this suggested tweak?


Viewing all articles
Browse latest Browse all 291195

Trending Articles