Skip to content

Instantly share code, notes, and snippets.

@mudrd8mz
Created November 4, 2013 16:58
Show Gist options
  • Save mudrd8mz/7305694 to your computer and use it in GitHub Desktop.
Save mudrd8mz/7305694 to your computer and use it in GitHub Desktop.
<?php
// Put this file into the dirroot of your Moodle 2.6beta and execute it, e.g.
//
// $ sudo -u apache php bg_locale_test.php
//
// Please report results to David or at MDLSITE-2580
define('CLI_SCRIPT', 1);
require_once(__DIR__.'/config.php');
$requested = 'bg_BG.UTF-8'; // as defined in bg.zip::langconfig.php
if (class_exists('Collator', false)) {
$collator = new Collator($requested);
$errorcode = $collator->getErrorCode();
$errormessage = $collator->getErrorMessage();
$actual = $collator->getLocale(Locale::ACTUAL_LOCALE);
$valid = $collator->getLocale(Locale::VALID_LOCALE);
fputs(STDOUT, sprintf("----
requested: %s
actual: %s
valid: %s
errorcode: %s
errormessage: %s
----
", $requested, $actual, $valid, $errorcode, $errormessage));
} else {
fputs(STDERR, 'Collator class not found.'.PHP_EOL);
exit(1);
}
@mudrd8mz
Copy link
Author

mudrd8mz commented Nov 4, 2013

At my notebook, I am getting

----
requested:    bg_BG.UTF-8
actual:       bg
valid:        bg
errorcode:    -128
errormessage: U_USING_FALLBACK_WARNING
----

@DanBennettUK
Copy link

requested: bg_BG.UTF-8
actual: ru
valid: bg
errorcode: -128
errormessage: U_USING_FALLBACK_WARNING

@stronk7
Copy link

stronk7 commented Nov 4, 2013

requested: bg_BG.UTF-8
actual: bg
valid: bg
errorcode: -128
errormessage: U_USING_FALLBACK_WARNING

(macosx, php 5.4)

@skodak
Copy link

skodak commented Nov 4, 2013

requested: bg_BG.UTF-8
actual: bg
valid: bg
errorcode: -128
errormessage: U_USING_FALLBACK_WARNING

macports php 5.5.5

@martignoni
Copy link

requested: bg_BG.UTF-8
actual: ru
valid: bg
errorcode: -128
errormessage: U_USING_FALLBACK_WARNING

Linux version 2.6.32-5-amd64 (Debian 2.6.32-48squeeze3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment