Initial commit

This commit is contained in:
Mauricio Dinarte 2024-07-22 21:38:34 -06:00
commit 1664d5cfe6
2772 changed files with 600692 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#locale-translation-filter-form .form-item-language,
#locale-translation-filter-form .form-item-translation,
#locale-translation-filter-form .form-item-group {
float: right;
padding-left: .8em;
padding-right: 0;
}
#locale-translation-filter-form .form-actions {
float: right;
padding: 3ex 1em 0 0;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,41 @@
<?php
/**
* @file
* Hooks provided by the Locale module.
*/
/**
* @addtogroup hooks
* @{
*/
/**
* Allows modules to define their own text groups that can be translated.
*
* @param $op
* Type of operation. Currently, only supports 'groups'.
*/
function hook_locale($op = 'groups') {
switch ($op) {
case 'groups':
return array('custom' => t('Custom'));
}
}
/**
* Allow modules to react to language settings changes.
*
* Every module needing to act when the number of enabled languages changes
* should implement this. This is an "internal" hook and should not be invoked
* elsewhere. The typical implementation would trigger some kind of rebuilding,
* this way system components could properly react to the change of the enabled
* languages number.
*/
function hook_multilingual_settings_changed() {
field_info_cache_clear();
}
/**
* @} End of "addtogroup hooks".
*/

View file

@ -0,0 +1,32 @@
.locale-untranslated {
font-style: normal;
text-decoration: line-through;
}
#locale-translation-filter-form .form-item-language,
#locale-translation-filter-form .form-item-translation,
#locale-translation-filter-form .form-item-group {
float: left; /* LTR */
padding-right: .8em; /* LTR */
margin: 0.1em;
/**
* In Opera 9, DOM elements with the property of "overflow: auto"
* will partially hide its contents with unnecessary scrollbars when
* its immediate child is floated without an explicit width set.
*/
width: 15em;
}
#locale-translation-filter-form .form-type-select select {
width: 100%;
}
#locale-translation-filter-form .form-actions {
float: left; /* LTR */
padding: 3ex 0 0 1em; /* LTR */
}
.language-switcher-locale-session a.active {
color: #0062A0;
}
.language-switcher-locale-session a.session-active {
color: #000000;
}

View file

@ -0,0 +1,79 @@
(function ($) {
/**
* Attaches language support to the jQuery UI datepicker component.
*/
Drupal.behaviors.localeDatepicker = {
attach: function(context, settings) {
// This code accesses Drupal.settings and localized strings via Drupal.t().
// So this code should run after these are initialized. By placing it in an
// attach behavior this is assured.
$.datepicker.regional['drupal-locale'] = $.extend({
closeText: Drupal.t('Done'),
prevText: Drupal.t('Prev'),
nextText: Drupal.t('Next'),
currentText: Drupal.t('Today'),
monthNames: [
Drupal.t('January'),
Drupal.t('February'),
Drupal.t('March'),
Drupal.t('April'),
Drupal.t('May'),
Drupal.t('June'),
Drupal.t('July'),
Drupal.t('August'),
Drupal.t('September'),
Drupal.t('October'),
Drupal.t('November'),
Drupal.t('December')
],
monthNamesShort: [
Drupal.t('Jan'),
Drupal.t('Feb'),
Drupal.t('Mar'),
Drupal.t('Apr'),
Drupal.t('May'),
Drupal.t('Jun'),
Drupal.t('Jul'),
Drupal.t('Aug'),
Drupal.t('Sep'),
Drupal.t('Oct'),
Drupal.t('Nov'),
Drupal.t('Dec')
],
dayNames: [
Drupal.t('Sunday'),
Drupal.t('Monday'),
Drupal.t('Tuesday'),
Drupal.t('Wednesday'),
Drupal.t('Thursday'),
Drupal.t('Friday'),
Drupal.t('Saturday')
],
dayNamesShort: [
Drupal.t('Sun'),
Drupal.t('Mon'),
Drupal.t('Tue'),
Drupal.t('Wed'),
Drupal.t('Thu'),
Drupal.t('Fri'),
Drupal.t('Sat')
],
dayNamesMin: [
Drupal.t('Su'),
Drupal.t('Mo'),
Drupal.t('Tu'),
Drupal.t('We'),
Drupal.t('Th'),
Drupal.t('Fr'),
Drupal.t('Sa')
],
dateFormat: Drupal.t('mm/dd/yy'),
firstDay: 0,
isRTL: 0
}, Drupal.settings.jquery.ui.datepicker);
$.datepicker.setDefaults($.datepicker.regional['drupal-locale']);
}
};
})(jQuery);

View file

@ -0,0 +1,12 @@
name = Locale
description = Adds language handling functionality and enables the translation of the user interface to languages other than English.
package = Core
version = VERSION
core = 7.x
files[] = locale.test
configure = admin/config/regional/language
; Information added by Drupal.org packaging script on 2024-03-06
version = "7.100"
project = "drupal"
datestamp = "1709734591"

View file

@ -0,0 +1,457 @@
<?php
/**
* @file
* Install, update and uninstall functions for the locale module.
*/
/**
* Implements hook_install().
*/
function locale_install() {
// locales_source.source and locales_target.target are not used as binary
// fields; non-MySQL database servers need to ensure the field type is text
// and that LIKE produces a case-sensitive comparison.
db_insert('languages')
->fields(array(
'language' => 'en',
'name' => 'English',
'native' => 'English',
'direction' => 0,
'enabled' => 1,
'weight' => 0,
'javascript' => '',
))
->execute();
}
/**
* @addtogroup updates-6.x-to-7.x
* @{
*/
/**
* Add context field index and allow longer location.
*/
function locale_update_7000() {
db_drop_index('locales_source', 'source');
db_add_index('locales_source', 'source_context', array(array('source', 30), 'context'));
// Also drop the 'textgroup_location' index added by the i18nstrings module
// of the i18n project, which prevents the below schema update from running.
if (db_index_exists('locales_source', 'textgroup_location')) {
db_drop_index('locales_source', 'textgroup_location');
}
db_change_field('locales_source', 'location', 'location', array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'description' => 'Drupal path in case of online discovered translations or file path in case of imported strings.',
));
}
/**
* Upgrade language negotiation settings.
*/
function locale_update_7001() {
require_once DRUPAL_ROOT . '/includes/language.inc';
require_once DRUPAL_ROOT . '/includes/locale.inc';
require_once DRUPAL_ROOT . '/modules/locale/locale.module';
switch (variable_get('language_negotiation', 0)) {
// LANGUAGE_NEGOTIATION_NONE.
case 0:
$negotiation = array();
break;
// LANGUAGE_NEGOTIATION_PATH_DEFAULT.
case 1:
$negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
// In Drupal 6 path prefixes are shown for the default language only when
// language negotiation is set to LANGUAGE_NEGOTIATION_PATH, while in
// Drupal 7 path prefixes are always shown if not empty. Hence we need to
// ensure that the default language has an empty prefix to avoid breaking
// the site URLs with a prefix that previously was missing.
$default = language_default();
$default->prefix = '';
variable_set('language_default', $default);
db_update('languages')
->fields(array('prefix' => $default->prefix))
->condition('language', $default->language)
->execute();
break;
// LANGUAGE_NEGOTIATION_PATH.
case 2:
$negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL, LOCALE_LANGUAGE_NEGOTIATION_USER, LOCALE_LANGUAGE_NEGOTIATION_BROWSER);
break;
// LANGUAGE_NEGOTIATION_DOMAIN.
case 3:
variable_set('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAIN);
$negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
break;
}
// Save the new language negotiation options.
language_negotiation_set(LANGUAGE_TYPE_INTERFACE, array_flip($negotiation));
language_negotiation_set(LANGUAGE_TYPE_CONTENT, array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE => 0));
language_negotiation_set(LANGUAGE_TYPE_URL, array(LOCALE_LANGUAGE_NEGOTIATION_URL => 0));
// Save admininstration UI settings.
$type = LANGUAGE_TYPE_INTERFACE;
$provider_weights = array_flip(array_keys(locale_language_negotiation_info()));
variable_set("locale_language_providers_weight_$type", $provider_weights);
// Unset the old language negotiation system variable.
variable_del('language_negotiation');
return array();
}
/**
* Updates URL language negotiation by adding the URL fallback detection method.
*/
function locale_update_7002() {
// language.inc may not have been included during bootstrap if there is not
// more than one language currently enabled.
require_once DRUPAL_ROOT . '/includes/language.inc';
$language_types_info = language_types_info();
$info = $language_types_info[LANGUAGE_TYPE_URL];
if (isset($info['fixed'])) {
language_negotiation_set(LANGUAGE_TYPE_URL, array_flip($info['fixed']));
}
}
/**
* @} End of "addtogroup updates-6.x-to-7.x".
*/
/**
* @addtogroup updates-7.x-extra
* @{
*/
/**
* Update "language_count" variable.
*/
function locale_update_7003() {
$languages = language_list('enabled');
variable_set('language_count', count($languages[1]));
}
/**
* Remove duplicates in {locales_source}.
*/
function locale_update_7004() {
// Look up all duplicates. For each set of duplicates, we select the row
// with the lowest lid as the "master" that will be preserved.
$result_source = db_query("SELECT MIN(lid) AS lid, source, context FROM {locales_source} WHERE textgroup = 'default' GROUP BY source, context HAVING COUNT(*) > 1");
$conflict = FALSE;
foreach ($result_source as $source) {
// Find all rows in {locales_target} that are translations of the same
// string (incl. context).
$result_target = db_query("SELECT t.lid, t.language, t.plural, t.translation FROM {locales_source} s JOIN {locales_target} t ON s.lid = t.lid WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default' ORDER BY lid", array(
':source' => $source->source,
':context' => $source->context,
));
$translations = array();
$keep_lids = array($source->lid);
foreach ($result_target as $target) {
if (!isset($translations[$target->language])) {
$translations[$target->language] = $target->translation;
if ($target->lid != $source->lid) {
// Move translation to the master lid.
db_query('UPDATE {locales_target} SET lid = :new_lid WHERE lid = :old_lid', array(
':new_lid' => $source->lid,
':old_lid' => $target->lid));
}
}
elseif ($translations[$target->language] == $target->translation) {
// Delete duplicate translation.
db_query('DELETE FROM {locales_target} WHERE lid = :lid AND language = :language', array(
':lid' => $target->lid,
':language' => $target->language));
}
else {
// The same string is translated into several different strings in one
// language. We do not know which is the preferred, so we keep them all.
$keep_lids[] = $target->lid;
$conflict = TRUE;
}
}
// Delete rows in {locales_source} that are no longer referenced from
// {locales_target}.
db_delete('locales_source')
->condition('source', $source->source)
->condition('context', $source->context)
->condition('textgroup', 'default')
->condition('lid', $keep_lids, 'NOT IN')
->execute();
}
if ($conflict) {
$url = 'http://drupal.org/node/746240';
drupal_set_message('Your {locales_source} table contains duplicates that could not be removed automatically. See <a href="' . $url .'" target="_blank">' . $url . '</a> for more information.', 'warning');
}
}
/**
* Increase {locales_languages}.formula column's length.
*/
function locale_update_7005() {
db_change_field('languages', 'formula', 'formula', array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Plural formula in PHP code to evaluate to get plural indexes.',
));
}
/**
* @} End of "addtogroup updates-7.x-extra".
*/
/**
* Implements hook_uninstall().
*/
function locale_uninstall() {
// Delete all JavaScript translation files.
$locale_js_directory = 'public://' . variable_get('locale_js_directory', 'languages');
if (is_dir($locale_js_directory)) {
$files = db_query('SELECT language, javascript FROM {languages}');
foreach ($files as $file) {
if (!empty($file->javascript)) {
file_unmanaged_delete($locale_js_directory . '/' . $file->language . '_' . $file->javascript . '.js');
}
}
// Delete the JavaScript translations directory if empty.
if (!file_scan_directory($locale_js_directory, '/.*/')) {
drupal_rmdir($locale_js_directory);
}
}
// Clear variables.
variable_del('language_default');
variable_del('language_count');
variable_del('language_types');
variable_del('locale_language_negotiation_url_part');
variable_del('locale_language_negotiation_session_param');
variable_del('language_content_type_default');
variable_del('language_content_type_negotiation');
variable_del('locale_cache_strings');
variable_del('locale_js_directory');
variable_del('javascript_parsed');
variable_del('locale_field_language_fallback');
variable_del('locale_cache_length');
foreach (language_types() as $type) {
variable_del("language_negotiation_$type");
variable_del("locale_language_providers_weight_$type");
}
foreach (node_type_get_types() as $type => $content_type) {
$setting = variable_del("language_content_type_$type");
}
// Switch back to English: with a $language->language value different from 'en'
// successive calls of t() might result in calling locale(), which in turn might
// try to query the unexisting {locales_source} and {locales_target} tables.
drupal_language_initialize();
}
/**
* Implements hook_schema().
*/
function locale_schema() {
$schema['languages'] = array(
'description' => 'List of all available languages in the system.',
'fields' => array(
'language' => array(
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => '',
'description' => "Language code, e.g. 'de' or 'en-US'.",
),
'name' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => 'Language name in English.',
),
'native' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => 'Native language name.',
),
'direction' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Direction of language (Left-to-Right = 0, Right-to-Left = 1).',
),
'enabled' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Enabled flag (1 = Enabled, 0 = Disabled).',
),
'plurals' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Number of plural indexes in this language.',
),
'formula' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Plural formula in PHP code to evaluate to get plural indexes.',
),
'domain' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'Domain to use for this language.',
),
'prefix' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'Path prefix to use for this language.',
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Weight, used in lists of languages.',
),
'javascript' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => 'Location of JavaScript translation file.',
),
),
'primary key' => array('language'),
'indexes' => array(
'list' => array('weight', 'name'),
),
);
$schema['locales_source'] = array(
'description' => 'List of English source strings.',
'fields' => array(
'lid' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => 'Unique identifier of this string.',
),
'location' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'description' => 'Drupal path in case of online discovered translations or file path in case of imported strings.',
),
'textgroup' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => 'default',
'description' => 'A module defined group of translations, see hook_locale().',
),
'source' => array(
'type' => 'text',
'mysql_type' => 'blob',
'not null' => TRUE,
'description' => 'The original string in English.',
),
'context' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'The context this string applies to.',
),
'version' => array(
'type' => 'varchar',
'length' => 20,
'not null' => TRUE,
'default' => 'none',
'description' => 'Version of Drupal, where the string was last used (for locales optimization).',
),
),
'primary key' => array('lid'),
'indexes' => array(
'source_context' => array(array('source', 30), 'context'),
),
);
$schema['locales_target'] = array(
'description' => 'Stores translated versions of strings.',
'fields' => array(
'lid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Source string ID. References {locales_source}.lid.',
),
'translation' => array(
'type' => 'text',
'mysql_type' => 'blob',
'not null' => TRUE,
'description' => 'Translation string value in this language.',
),
'language' => array(
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => '',
'description' => 'Language code. References {languages}.language.',
),
'plid' => array(
'type' => 'int',
'not null' => TRUE, // This should be NULL for no referenced string, not zero.
'default' => 0,
'description' => 'Parent lid (lid of the previous string in the plural chain) in case of plural strings. References {locales_source}.lid.',
),
'plural' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Plural index number in case of plural strings.',
),
),
'primary key' => array('language', 'lid', 'plural'),
'foreign keys' => array(
'locales_source' => array(
'table' => 'locales_source',
'columns' => array('lid' => 'lid'),
),
),
'indexes' => array(
'lid' => array('lid'),
'plid' => array('plid'),
'plural' => array('plural'),
),
);
return $schema;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
name = "Locale Test"
description = "Support module for the locale layer tests."
core = 7.x
package = Testing
version = VERSION
hidden = TRUE
; Information added by Drupal.org packaging script on 2024-03-06
version = "7.100"
project = "drupal"
datestamp = "1709734591"

View file

@ -0,0 +1,46 @@
Drupal.t("Standard Call t");
Drupal
.
t
(
"Whitespace Call t"
)
;
Drupal.t('Single Quote t');
Drupal.t('Single Quote \'Escaped\' t');
Drupal.t('Single Quote ' + 'Concat ' + 'strings ' + 't');
Drupal.t("Double Quote t");
Drupal.t("Double Quote \"Escaped\" t");
Drupal.t("Double Quote " + "Concat " + "strings " + "t");
Drupal.t("Context Unquoted t", {}, {context: "Context string unquoted"});
Drupal.t("Context Single Quoted t", {}, {'context': "Context string single quoted"});
Drupal.t("Context Double Quoted t", {}, {"context": "Context string double quoted"});
Drupal.t("Context !key Args t", {'!key': 'value'}, {context: "Context string"});
Drupal.formatPlural(1, "Standard Call plural", "Standard Call @count plural");
Drupal
.
formatPlural
(
1,
"Whitespace Call plural",
"Whitespace Call @count plural"
)
;
Drupal.formatPlural(1, 'Single Quote plural', 'Single Quote @count plural');
Drupal.formatPlural(1, 'Single Quote \'Escaped\' plural', 'Single Quote \'Escaped\' @count plural');
Drupal.formatPlural(1, "Double Quote plural", "Double Quote @count plural");
Drupal.formatPlural(1, "Double Quote \"Escaped\" plural", "Double Quote \"Escaped\" @count plural");
Drupal.formatPlural(1, "Context Unquoted plural", "Context Unquoted @count plural", {}, {context: "Context string unquoted"});
Drupal.formatPlural(1, "Context Single Quoted plural", "Context Single Quoted @count plural", {}, {'context': "Context string single quoted"});
Drupal.formatPlural(1, "Context Double Quoted plural", "Context Double Quoted @count plural", {}, {"context": "Context string double quoted"});
Drupal.formatPlural(1, "Context !key Args plural", "Context !key Args @count plural", {'!key': 'value'}, {context: "Context string"});

View file

@ -0,0 +1,242 @@
<?php
/**
* @file
* Mock module for locale layer tests.
*/
/**
* Implements hook_locale().
*/
function locale_test_locale($op = 'groups') {
switch ($op) {
case 'groups':
return array('custom' => t('Custom'));
}
}
/**
* Implements hook_boot().
*
* For testing domain language negotiation, we fake it by setting
* the HTTP_HOST here
*/
function locale_test_boot() {
if (variable_get('locale_test_domain')) {
$_SERVER['HTTP_HOST'] = variable_get('locale_test_domain');
}
}
/**
* Implements hook_init().
*/
function locale_test_init() {
locale_test_store_language_negotiation();
if (isset($GLOBALS['language']) && isset($GLOBALS['language']->provider)) {
drupal_set_message(t('Language negotiation provider: @name', array('@name' => $GLOBALS['language']->provider)));
}
}
/**
* Implements hook_language_types_info().
*/
function locale_test_language_types_info() {
if (variable_get('locale_test_language_types', FALSE)) {
return array(
'test_language_type' => array(
'name' => t('Test'),
'description' => t('A test language type.'),
),
'fixed_test_language_type' => array(
'fixed' => array('test_language_provider'),
),
);
}
}
/**
* Implements hook_menu().
*
* @return array
*/
function locale_test_menu() {
$items = array();
$items['locale_test_plural_format_page'] = array(
'page callback' => 'locale_test_plural_format_page',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* Implements hook_language_types_info_alter().
*/
function locale_test_language_types_info_alter(array &$language_types) {
if (variable_get('locale_test_content_language_type', FALSE)) {
unset($language_types[LANGUAGE_TYPE_CONTENT]['fixed']);
}
}
/**
* Implements hook_language_negotiation_info().
*/
function locale_test_language_negotiation_info() {
if (variable_get('locale_test_language_negotiation_info', FALSE)) {
$info = array(
'callbacks' => array(
'language' => 'locale_test_language_provider',
),
'file' => drupal_get_path('module', 'locale_test') .'/locale_test.module',
'weight' => -10,
'description' => t('This is a test language provider.'),
);
return array(
'test_language_provider' => array(
'name' => t('Test'),
'types' => array(LANGUAGE_TYPE_CONTENT, 'test_language_type', 'fixed_test_language_type'),
) + $info,
'test_language_provider_ts' => array(
'name' => t('Type-specific test'),
'types' => array('test_language_type'),
) + $info,
);
}
}
/**
* Implements hook_language_negotiation_info_alter().
*/
function locale_test_language_negotiation_info_alter(array &$language_providers) {
if (variable_get('locale_test_language_negotiation_info_alter', FALSE)) {
unset($language_providers[LOCALE_LANGUAGE_NEGOTIATION_INTERFACE]);
}
}
/**
* Store the last negotiated languages.
*/
function locale_test_store_language_negotiation() {
$last = array();
foreach (language_types() as $type) {
$last[$type] = $GLOBALS[$type]->language;
}
variable_set('locale_test_language_negotiation_last', $last);
}
/**
* Test language provider.
*/
function locale_test_language_provider($languages) {
return 'it';
}
/**
* Returns markup for locale_get_plural testing.
*
* @return array
*/
function locale_test_plural_format_page() {
$tests = _locale_test_plural_format_tests();
$result = array();
foreach ($tests as $test) {
$string_param = array(
'@lang' => $test['language'],
'@locale_get_plural' => locale_get_plural($test['count'], $test['language'])
);
$result[] = array(
'#prefix' => '<br/>',
'#markup' => format_string('Language: @lang, locale_get_plural: @locale_get_plural.', $string_param),
);
}
return $result;
}
/**
* Helper function with list of test cases
*
* @return array
*/
function _locale_test_plural_format_tests() {
return array(
// Test data for English (no formula present).
array(
'count' => 1,
'language' => 'en',
'expected-result' => 0,
),
array(
'count' => 0,
'language' => 'en',
'expected-result' => 1,
),
array(
'count' => 5,
'language' => 'en',
'expected-result' => 1,
),
// Test data for French (simpler formula).
array(
'count' => 1,
'language' => 'fr',
'expected-result' => 0,
),
array(
'count' => 0,
'language' => 'fr',
'expected-result' => 1,
),
array(
'count' => 5,
'language' => 'fr',
'expected-result' => 1,
),
// Test data for Croatian (more complex formula).
array(
'count' => 1,
'language' => 'hr',
'expected-result' => 0,
),
array(
'count' => 21,
'language' => 'hr',
'expected-result' => 0,
),
array(
'count' => 0,
'language' => 'hr',
'expected-result' => 2,
),
array(
'count' => 2,
'language' => 'hr',
'expected-result' => 1,
),
array(
'count' => 8,
'language' => 'hr',
'expected-result' => 2,
),
// Test data for Hungarian (nonexistent language).
array(
'count' => 1,
'language' => 'hu',
'expected-result' => -1,
),
array(
'count' => 21,
'language' => 'hu',
'expected-result' => -1,
),
array(
'count' => 0,
'language' => 'hu',
'expected-result' => -1,
),
);
}

View file

@ -0,0 +1,28 @@
msgid ""
msgstr ""
"Project-Id-Version: Drupal 7\\n"
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset=UTF-8\\n"
"Content-Transfer-Encoding: 8bit\\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\\n"
msgid "Monday"
msgstr "lundi"
msgid "Tuesday"
msgstr "mardi"
msgid "Wednesday"
msgstr "mercredi"
msgid "Thursday"
msgstr "jeudi"
msgid "Friday"
msgstr "vendredi"
msgid "Saturday"
msgstr "samedi"
msgid "Sunday"
msgstr "dimanche"