Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mahara-scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
mahara
mahara-scripts
Commits
160fa6e6
Commit
160fa6e6
authored
May 30, 2011
by
Richard Mansfield
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use older File::Path stuff for chatter
parent
5ee80ad6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
mahara-langpacks/langpacks.pl
mahara-langpacks/langpacks.pl
+10
-10
mahara-langpacks/po-php.pl
mahara-langpacks/po-php.pl
+3
-3
No files found.
mahara-langpacks/langpacks.pl
View file @
160fa6e6
...
...
@@ -17,7 +17,7 @@
use
Data::
Dumper
;
use
FindBin
;
use
File::
Path
qw(m
ake_path remove_
tree)
;
use
File::
Path
qw(m
kpath rm
tree)
;
foreach
my
$c
qw(DATA DOCROOT)
{
exists
$ENV
{
$c
}
or
die
("
\$
ENV{
$c
} undefined
");
...
...
@@ -36,10 +36,10 @@ my $DIRTY = "${DATA}/old";
my
$CLEAN
=
"
${DATA}
/new
";
my
$TARBALLS
=
"
${DATA}
/tarballs
";
m
ake_
path
$GITDIR
;
m
ake_
path
$DIRTY
;
m
ake_
path
$CLEAN
;
m
ake_
path
$TARBALLS
;
m
k
path
$GITDIR
;
m
k
path
$DIRTY
;
m
k
path
$CLEAN
;
m
k
path
$TARBALLS
;
print
STDERR
"
Checking langpacks for updates:
"
.
`
date
\
"+%Y-%m-%d %H:%M:%S
\
"
`;
...
...
@@ -69,8 +69,8 @@ foreach my $lang (@langs) {
system
"
git clone --quiet
$remote
$gitlangdir
";
}
m
ake_
path
$dirtylangdir
;
m
ake_
path
$cleanlangdir
;
m
k
path
$dirtylangdir
;
m
k
path
$cleanlangdir
;
chdir
$gitlangdir
;
system
"
git fetch --quiet
";
...
...
@@ -122,8 +122,8 @@ foreach my $lang (@langs) {
$last
->
{
$lang
}
->
{
branches
}
->
{
$localbranch
}
->
{
errors
}
=
'';
my
$cleanbranchdir
=
"
$cleanlangdir
/
$localbranch
";
-
d
"
$cleanbranchdir
/lang
"
&&
r
emove_
tree
$cleanbranchdir
;
!
-
d
$cleanbranchdir
&&
m
ake_
path
$cleanbranchdir
;
-
d
"
$cleanbranchdir
/lang
"
&&
r
m
tree
$cleanbranchdir
;
!
-
d
$cleanbranchdir
&&
m
k
path
$cleanbranchdir
;
my
$pofile
=
"
$gitlangdir
/mahara/
$lang
.po
";
...
...
@@ -158,7 +158,7 @@ foreach my $lang (@langs) {
# sanitise langpack
my
$dirtybranchdir
=
"
$dirtylangdir
/
$localbranch
";
!
-
d
$dirtybranchdir
&&
m
ake_
path
$dirtybranchdir
;
!
-
d
$dirtybranchdir
&&
m
k
path
$dirtybranchdir
;
system
("
cp -r
$gitlangdir
/
"
.
'
[a-z]*
'
.
$dirtybranchdir
);
...
...
mahara-langpacks/po-php.pl
View file @
160fa6e6
...
...
@@ -10,7 +10,7 @@
# po-php.pl /path/to/po/files/fr-1.3_STABLE.po /path/to/langpacks/fr.utf8 fr.utf8
use
File::
Path
qw(m
ake_
path)
;
use
File::
Path
qw(m
k
path)
;
use
File::
Basename
qw(fileparse)
;
use
Locale::
PO
;
...
...
@@ -40,7 +40,7 @@ foreach my $po (@$strings) {
foreach
my
$htmlfile
(
keys
%htmlfiles
)
{
my
(
$filename
,
$subdir
,
$suffix
)
=
fileparse
(
$htmlfile
);
my
$dir
=
$outputdir
.
'
/
'
.
$subdir
;
m
ake_
path
(
$dir
);
m
k
path
(
$dir
);
open
(
my
$fh
,
'
>
',
"
$dir
/
$filename
");
print
$fh
$htmlfiles
{
$htmlfile
};
close
$fh
;
...
...
@@ -49,7 +49,7 @@ foreach my $htmlfile (keys %htmlfiles) {
foreach
my
$phpfile
(
keys
%phpfiles
)
{
my
(
$filename
,
$subdir
,
$suffix
)
=
fileparse
(
$phpfile
);
my
$dir
=
$outputdir
.
'
/
'
.
$subdir
;
m
ake_
path
(
$dir
);
m
k
path
(
$dir
);
open
(
my
$fh
,
'
>
',
"
$dir
/
$filename
");
print
$fh
"
<?php
\n\n
defined('INTERNAL') || die();
\n\n
";
foreach
my
$key
(
sort
keys
%
{
$phpfiles
{
$phpfile
}})
{
...
...
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