A script to create & apply language patches for ownCloud
-
Create a file named
find_strings
-
In each line, write a relative path and a filename of the string that needs to be patched inside double quotes and the original English string itself. Make sure that you used no punctuation at the end of the sentence!
e.g.
"settings", "Dummy string" "apps/files_external", "Here is the second string"
-
Run script.
-
To use as console script, run
php5 find.php
in the root directory of ownCloud. -
Otherwise, call the script using http://<host>/find.php
This will search the strings written in
find_strings
file in specified app'sl10n
directory and copy the available translations intocopy_strings
file.
-
-
Check for errors and the contents of
copy_strings
file. -
Switch to another branch which the patch should be applied to.
-
Call the script again using "start" argument.
- For console:
php5 find.php start
- For browser, first, you need to change the permissions of all
l10n
files inside ownCloud dir. For this, run:
find . -maxdepth 4 -type d -name "l10n" -exec sh -c 'cd "{}"/../ && pwd && chmod -R 777 *' \;
inside terminal. Append
?start
argument end of the address and change the permissions back by invoking this command:find . -maxdepth 4 -type d -name "l10n" -exec sh -c 'cd "{}"/../ && pwd && chmod -R 775 *' \;
- For console:
-
Commit & push
- Clone the repository
- Run
php5 find.php
- Change into
stable
branch:git checkout stable
- Apply the created patch
php5 find.php start
- Check the difference
git diff
Alternatively, browser can be used to call the script. See usage section above.
- Extract the relevant strings from the given commit
See wiki page