forked from emaijala/MLInvoice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalize.php
More file actions
executable file
·44 lines (35 loc) · 1.32 KB
/
localize.php
File metadata and controls
executable file
·44 lines (35 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/*******************************************************************************
MLInvoice: web-based invoicing application.
Copyright (C) 2010-2016 Ere Maijala
This program is free software. See attached LICENSE.
*******************************************************************************/
/*******************************************************************************
MLInvoice: web-pohjainen laskutusohjelma.
Copyright (C) 2010-2016 Ere Maijala
Tämä ohjelma on vapaa. Lue oheinen LICENSE.
*******************************************************************************/
require_once 'sessionfuncs.php';
if (!session_id()) {
session_start();
}
$language = isset($_SESSION['sesLANG']) ? $_SESSION['sesLANG'] : (defined(
'_UI_LANGUAGE_') ? _UI_LANGUAGE_ : 'fi-FI');
if (!file_exists("lang/$language.ini")) {
$language = 'fi-FI';
}
$languageStrings = parse_ini_file("lang/$language.ini");
if (file_exists("lang/$language.local.ini")) {
$languageStrings = array_merge($languageStrings,
parse_ini_file("lang/$language.local.ini"));
}
foreach ($languageStrings as $key => $value) {
$GLOBALS["loc$key"] = $value;
}
if (_CHARSET_ != 'UTF-8') {
foreach ($GLOBALS as $key => &$tr) {
if (substr($key, 0, 3) == 'loc' && is_string($tr)) {
$tr = utf8_decode($tr);
}
}
}