-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtx-cleanup.sh
More file actions
23 lines (22 loc) · 763 Bytes
/
tx-cleanup.sh
File metadata and controls
23 lines (22 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
#
# Clean up translations pulled from Transifex
# Should be applied only to resources in the 'Joomla' format
# (Currently that's the case for all resources.)
# ----------------------------------------------------------------------------
# Written by Tom Reynolds <tomreyn@megaglest.org>
# Copyright (c) 2012 Tom Reynolds under GNU GPL v3.0
for file in `find . -type f -name *.lng`
do
# Rewrite " to "
# Remove blank space off beginning (behind '=') and end of translated strings because they belong into the code instead, and because Transifex would double them.
sed -i \
-e 's/"/"/g' \
-e 's/^\([^=]*\)=\s*/\1=/' \
-e 's/\s*$//' \
-e 's/ */ /g' \
-e 's/⏎/\\n/g' \
-e 's/ \\n/\\n/g' \
-e 's/\\n /\\n/g' \
$file
done