Skip to content

Commit

Permalink
Added language module
Browse files Browse the repository at this point in the history
  • Loading branch information
s-rayleigh committed Sep 12, 2018
1 parent 0316fb8 commit fb0c20c
Show file tree
Hide file tree
Showing 10 changed files with 1,604 additions and 0 deletions.
34 changes: 34 additions & 0 deletions app/Languages/en/main.lng
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Language example file

> name: English

ok: Ok
cancel: Cancel
help: Help

[group:auth]
login: Login
username: Username
email: E-mail
pass: Password

[group:login_grp]
> keywords: test, something, keyword
lost_pass: Forgot your password?
sign_in: Sign in
[end:login_grp]

[group:register]
register: Sign up
username_placeholder: Enter username...
username_tooltip: Only letters of the English alphabet.
email_placeholder: Enter {auth.email}...
email_tooltip: Enter your real e-mail.
pass_placeholder: Enter password...
pass_tooltip: Must not be less than 4 characters.
[end:register]

> include test
[end:auth]

test: Test string
4 changes: 4 additions & 0 deletions app/Languages/en/test.lng
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> group: test_group
> keywords: test

test_phrase: Some text...
12 changes: 12 additions & 0 deletions app/Languages/ru.lng
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

> name: Русский
> fallback: en

ok: Ок
cancel: Отмена
help: Помощь

[group:auth]
> keywords: test
login: Логин
[end:auth]
1 change: 1 addition & 0 deletions config/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

return
[
'Lang',
'TemplateProcessor',
'Page', //Requires TemplateProcessor module
// 'MySql',
Expand Down
43 changes: 43 additions & 0 deletions config/modules/lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Language module parameters.
* This file is part of Iridium Core project.
*
* Iridium Core is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Iridium Core is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Iridium Core. If not, see <http://www.gnu.org/licenses/>.
*
* @author rayleigh <rayleigh@protonmail.com>
* @copyright 2018 Vladislav Pashaiev
* @license LGPL-3.0+
*/

return
[
// List of the codes of languages to load
'languages' => ['en', 'ru'],

// Code of the fallback language
'fallback' => 'en',

// Code of the default language
'default' => 'en',

// Cache enabled
'cache' => true,

// Path to the language files
'lang_path' => 'app/Languages',

// Path to the language cache
'cache_path' => 'storage/cache/lang'
];
Loading

0 comments on commit fb0c20c

Please sign in to comment.