Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
f67123c5
Commit
f67123c5
authored
10 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
l10n.pl now generates js files as well
parent
cb944814
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
l10n/init.sh
+0
-5
0 additions, 5 deletions
l10n/init.sh
l10n/l10n.pl
+10
-0
10 additions, 0 deletions
l10n/l10n.pl
with
10 additions
and
5 deletions
l10n/init.sh
deleted
100755 → 0
+
0
−
5
View file @
cb944814
#!/bin/bash
for
resource
in
calendar contacts core files media gallery settings
do
tx
set
--auto-local
-r
owncloud.
$resource
"<lang>/
$resource
.po"
--source-lang
en
--source-file
templates/
$resource
.pot
--execute
done
This diff is collapsed.
Click to expand it.
l10n/l10n.pl
+
10
−
0
View file @
f67123c5
...
@@ -142,6 +142,7 @@ elsif( $task eq 'write' ){
...
@@ -142,6 +142,7 @@ elsif( $task eq 'write' ){
my
$array
=
Locale::
PO
->
load_file_asarray
(
$input
);
my
$array
=
Locale::
PO
->
load_file_asarray
(
$input
);
# Create array
# Create array
my
@strings
=
();
my
@strings
=
();
my
@js_strings
=
();
my
$plurals
;
my
$plurals
;
foreach
my
$string
(
@
{
$array
}
){
foreach
my
$string
(
@
{
$array
}
){
...
@@ -160,11 +161,13 @@ elsif( $task eq 'write' ){
...
@@ -160,11 +161,13 @@ elsif( $task eq 'write' ){
}
}
push
(
@strings
,
"
\"
$identifier
\"
=> array(
"
.
join
("
,
",
@variants
)
.
"
)
");
push
(
@strings
,
"
\"
$identifier
\"
=> array(
"
.
join
("
,
",
@variants
)
.
"
)
");
push
(
@js_strings
,
"
\"
$identifier
\"
: [
"
.
join
("
,
",
@variants
)
.
"
]
");
}
}
else
{
else
{
# singular translations
# singular translations
next
if
$string
->
msgstr
()
eq
'
""
';
next
if
$string
->
msgstr
()
eq
'
""
';
push
(
@strings
,
$string
->
msgid
()
.
"
=>
"
.
$string
->
msgstr
());
push
(
@strings
,
$string
->
msgid
()
.
"
=>
"
.
$string
->
msgstr
());
push
(
@js_strings
,
$string
->
msgid
()
.
"
:
"
.
$string
->
msgstr
());
}
}
}
}
next
if
$#strings
==
-
1
;
# Skip empty files
next
if
$#strings
==
-
1
;
# Skip empty files
...
@@ -179,6 +182,13 @@ elsif( $task eq 'write' ){
...
@@ -179,6 +182,13 @@ elsif( $task eq 'write' ){
print
OUT
join
(
"
,
\n
",
@strings
);
print
OUT
join
(
"
,
\n
",
@strings
);
print
OUT
"
\n
);
\n\$
PLURAL_FORMS =
\"
$plurals
\"
;
\n
";
print
OUT
"
\n
);
\n\$
PLURAL_FORMS =
\"
$plurals
\"
;
\n
";
close
(
OUT
);
close
(
OUT
);
open
(
OUT
,
"
>
$language
.js
"
);
print
OUT
"
OC.L10N.register(
\n
\"
$app
\"
,
\n
{
\n
";
print
OUT
join
(
"
,
\n
",
@js_strings
);
print
OUT
"
\n
},
\n\"
$plurals
\"
);
\n
";
close
(
OUT
);
}
}
chdir
(
$whereami
);
chdir
(
$whereami
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment