Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
8f13111b
Commit
8f13111b
authored
Jun 30, 2014
by
pupi1985
Committed by
Scott
Oct 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added metadata to the translations
parent
86d7c84f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
7 deletions
+53
-7
qa-app-admin.php
qa-include/qa-app-admin.php
+18
-7
qa-lang-metadata.php
qa-lang/en-GB/qa-lang-metadata.php
+35
-0
No files found.
qa-include/qa-app-admin.php
View file @
8f13111b
...
...
@@ -66,7 +66,11 @@
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
$codetolanguage
=
array
(
// 2-letter language codes as per ISO 639-1
/*
* @deprecated The hardcoded language ids will be removed in favor of language metadata files.
* See qa-lang/en-GB directory for a clear example of how to use them.
*/
$codetolanguage
=
array
(
// 2-letter language codes as per ISO 639-1
'ar'
=>
'Arabic - العربية'
,
'az'
=>
'Azerbaijani - Azərbaycanca'
,
'bg'
=>
'Bulgarian - Български'
,
...
...
@@ -117,17 +121,24 @@
'zh'
=>
'Chinese Simplified - 简体中文'
,
);
$options
=
array
(
''
=>
'English (US)'
);
$options
=
array
(
''
=>
'English (US)'
);
$directory
=
@
opendir
(
QA_LANG_DIR
);
$directory
=
@
opendir
(
QA_LANG_DIR
);
if
(
is_resource
(
$directory
))
{
while
((
$code
=
readdir
(
$directory
))
!==
false
)
if
(
is_dir
(
QA_LANG_DIR
.
$code
)
&&
isset
(
$codetolanguage
[
$code
]))
$options
[
$code
]
=
$codetolanguage
[
$code
];
while
((
$code
=
readdir
(
$directory
))
!==
false
)
{
if
(
is_dir
(
QA_LANG_DIR
.
$code
)
&&
isset
(
$codetolanguage
[
$code
]))
$options
[
$code
]
=
$codetolanguage
[
$code
];
}
closedir
(
$directory
);
}
foreach
(
glob
(
QA_LANG_DIR
.
'*/qa-lang-metadata.php'
)
as
$filename
)
{
$code
=
basename
(
dirname
(
$filename
));
$metadata
=
include
QA_LANG_DIR
.
$code
.
'/qa-lang-metadata.php'
;
if
(
isset
(
$metadata
[
'display_name'
]))
$options
[
$code
]
=
$metadata
[
'display_name'
];
}
asort
(
$options
,
SORT_STRING
);
return
$options
;
...
...
qa-lang/en-GB/qa-lang-metadata.php
0 → 100644
View file @
8f13111b
<?php
/*
Question2Answer (c) Gideon Greenspan
http://www.question2answer.org/
File: qa-lang/en-GB/qa-lang-metadata.php
Version: See define()s at top of qa-include/qa-base.php
Description: Contains metadata about the translations
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program 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 General Public License for more details.
More about this license: http://www.question2answer.org/license.php
*/
return
array
(
'display_name'
=>
'English (UK)'
,
);
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment