Commit graph

18 commits

Author SHA1 Message Date
Lukas Fleischer
c557f348c4 Fix SQL query to retrieve language setting
In commit e171f6f (Migrate all DB code to use PDO, 2012-08-08),
PDOStatement::fetchAll() was introduced as a drop-in replacement for
mysql_fetch_array(). However, PDOStatement::fetchAll() returns a list of
all results while mysql_fetch_array() returns a single result only.
Instead of adding the missing indirection, simplify the code by using
PDO::fetchColumn().

Also add some safeguards to prevent warnings if the result set returned
by the query is empty.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-27 19:49:15 +01:00
Mark Weiman
ddbffcc4d5 Remove extraneous quote in translator.inc.php
The quote is a leftover of legacy code and was meant to be removed by
commit e171f6f (Migrate all DB code to use PDO, 2012-08-08).

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-10 18:31:20 +01:00
Lukas Fleischer
6852a0c2af Add Arabic translation
Implements FS#45430.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Lukas Fleischer
9b19f7595e Add Spanish (Latin America) and Asturian translations
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 08:52:08 +02:00
Lukas Fleischer
87df56e30b Fix official language name of Czech
Reported-by: Pablo Lezaeta Reyes <prflr88@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 08:49:21 +02:00
Lukas Fleischer
f13160f5cf Add Chinese (Taiwan) translations
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 14:26:26 +02:00
Lukas Fleischer
76343fb915 Use an INI-style configuration file
Replace web/lib/config.inc.php with an INI-style configuration file.
This allows us to get rid of several globals and makes it easier to use
the same configuration file in external scripts.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-10-24 10:03:54 +02:00
Lukas Fleischer
7f29756196 Handle plurals in translations
Use ngettext() to handle plurals properly. Also, split pagination
captions into two strings.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-04 12:16:58 +02:00
Lukas Fleischer
bc93e68dc7 Set language using a POST request
Fixes FS#39027.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-13 14:19:55 +02:00
Lukas Fleischer
be80aa0f01 Add Japanese and Slovak languages
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-26 18:45:10 +02:00
canyonknight
8e03e68d68 Add database wrapper class and new connection method
Uses the Singleton pattern to ensure all queries use the same
database connection that is released upon script completion.

All database connections should now be called with DB::connect() and
not db_connect().

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-02-10 12:10:37 +01:00
Marcel Korpel
987faad145 Changed 'Dutch' to 'Nederlands'
Supported languages are listed in their native language. Only Dutch is
in English. Translate reference into Dutch.

canyonknight: Commit message clarity

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-12-22 17:01:54 +01:00
Lukas Fleischer
d56a88897b Avoid use of "<b>"/"</b>"
* Use "<label>"/"</label>" for form labels.
* Use "<strong>"/"</strong>" for important text.
* Use "<h4>"/"</h4>" for headings.
* Drop "<b>"/"</b>" everywhere else.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-24 12:23:05 +02:00
canyonknight
e171f6f34e Migrate all DB code to use PDO
All DB code currently uses the quickly aging mysql_* functions. These
functions are strongly discouraged and may eventually be deprecated.

Transition all code to utilize the PDO data access abstraction layer. PDO
allows for consistent query code across multiple databases. This could
potentially allow for someone to use a database other than MySQL with
minimal code changes.

All functions and behaviors are reproduced as faithfully as possible with
PDO equivalents and some changes in code.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 00:58:46 +02:00
Lukas Fleischer
1e29bd2217 Merge branch 'maint'
Conflicts:
	UPGRADING
	web/lib/config.inc.php.proto
2012-03-09 09:27:49 +01:00
Dan McGee
bd361242f9 Move SUPPORTED_LANGS out of config.inc.php
This has no real business being here, and is a pain to update when new
languages are shipped. Move it and the set_lang() function to
translator.inc.php instead so it doesn't overwhelm the user-configurable
settings file with static stuff.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-24 17:57:51 +02:00
Lukas Fleischer
b5d5687517 web/lib/translator.inc.php: Use vsprintf() in __()
Remove hacky substitution code from __() and use vsprintf() instead
which will deal with all sorts of format strings properly.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-08-20 20:28:47 +02:00
elij
888db089c5 rename *.inc files to *.inc.php and adjust imports and references
Lukas: Add note to "UPGRADING".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-06-22 15:15:04 +02:00
Renamed from web/lib/translator.inc (Browse further)