forked from emaijala/MLInvoice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalize_invoice_pdf.php
More file actions
47 lines (39 loc) · 1.48 KB
/
localize_invoice_pdf.php
File metadata and controls
47 lines (39 loc) · 1.48 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
45
46
47
<?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.
*******************************************************************************/
function initInvoicePDFLocalizations($language)
{
if (!isset($language)) {
$language = 'fi-FI';
} elseif ($language == 'en') {
$language = 'en-US';
} elseif ($language == 'fi') {
$language = 'fi-FI';
}
if (!file_exists("lang/invoice_$language.ini")) {
$language = 'fi-FI';
}
$languageStrings = parse_ini_file("lang/invoice_$language.ini");
if (file_exists("lang/invoice_$language.local.ini")) {
$languageStrings = array_merge($languageStrings,
parse_ini_file("lang/invoice_$language.local.ini"));
}
foreach ($languageStrings as $key => $value) {
$GLOBALS["locPDF$key"] = $value;
}
if (_CHARSET_ != 'UTF-8') {
foreach ($GLOBALS as $key => &$tr) {
if (substr($key, 0, 3) == 'locPDF' && is_string($tr)) {
$tr = utf8_decode($tr);
}
}
}
}