Skip to content
Permalink
Browse files

Update to latest

SHA 81cf9e203ed8cc4524418f154a6d9ede4cf5116a
  • Loading branch information...
Jsthon
Jsthon committed Jan 13, 2016
1 parent 39ca0c1 commit b6221e115145002ad6a8fd767ef62d4886a58215
Showing with 6 additions and 36 deletions.
  1. +1 −1 LICENSE
  2. +4 −35 bootstrap.php
  3. +1 −0 locale/core.yml
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Jsthon Wong
Copyright (c) 2015-2016 Jsthon Wong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -1,41 +1,10 @@
<?php
use Illuminate\Contracts\Events\Dispatcher;
use Flarum\Event\ConfigureLocales;
use Illuminate\Contracts\Events\Dispatcher;
return function (Dispatcher $events) {
$events->listen(ConfigureLocales::class, function(ConfigureLocales $event) {
$name = $title = basename(__DIR__);
if (file_exists($manifest = __DIR__.'/composer.json')) {
$json = json_decode(file_get_contents($manifest), true);
if (empty($json)) {
throw new RuntimeException("Error parsing composer.json in $name: ".json_last_error_msg());
}
$locale = array_get($json, 'extra.flarum-locale.code');
$title = array_get($json, 'extra.flarum-locale.title', $title);
}
if (! isset($locale)) {
throw new RuntimeException("Language pack $name must define \"extra.flarum-locale.code\" in composer.json.");
}
$event->locales->addLocale($locale, $title);
if (! is_dir($localeDir = __DIR__.'/locale')) {
throw new RuntimeException("Language pack $name must have a \"locale\" subdirectory.");
}
if (file_exists($file = $localeDir.'/config.js')) {
$event->locales->addJsFile($locale, $file);
}
foreach (new DirectoryIterator($localeDir) as $file) {
if ($file->isFile() && in_array($file->getExtension(), ['yml', 'yaml'])) {
$event->locales->addTranslations($locale, $file->getPathname());
}
}
$events->listen(ConfigureLocales::class, function (ConfigureLocales $event) {
$event->loadLanguagePackFrom(__DIR__);
});
};
};
@@ -229,6 +229,7 @@ core:
index:
all_discussions_link: => core.ref.all_discussions
cannot_start_discussion_button: 无法发布话题
mark_all_as_read_confirmation: "确认全部标记为已读?"
mark_all_as_read_tooltip: => core.ref.mark_all_as_read
refresh_tooltip: 刷新
start_discussion_button: => core.ref.start_a_discussion

0 comments on commit b6221e1

Please sign in to comment.
You can’t perform that action at this time.