Skip to content

Commit

Permalink
Clean-up and new localization process
Browse files Browse the repository at this point in the history
  • Loading branch information
Zverik committed Jun 17, 2024
1 parent 42491e2 commit 66a099f
Show file tree
Hide file tree
Showing 45 changed files with 6,718 additions and 126 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
www/data/
www/locale/
ww/locale/
/vendor/
locales/transifex_config
*.db
Expand Down
12 changes: 12 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[main]
host = https://app.transifex.com

[o:openstreetmap:p:level0:r:messages]
file_filter = www/locale/<lang>/LC_MESSAGES/messages.mo
source_file = messages.pot
type = PO
minimum_perc = 50
resource_name = " Messages "
replace_edited_strings = false
keep_translations = false

14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
# Level0 OpenStreetMap Editor

This is a text-based in-browser editor for OSM data. See [its wiki page](http://wiki.openstreetmap.org/wiki/Level0) and [language guide](http://wiki.openstreetmap.org/wiki/Level0L).
This is a text-based in-browser editor for OSM data.
See [its wiki page](http://wiki.openstreetmap.org/wiki/Level0)
and [language guide](http://wiki.openstreetmap.org/wiki/Level0L).

## Installation

You will need PHP with `mod_gettext`.

* Point your `DocumentRoot` to the `www` directory.
* Run `composer install`.
* Open [this link](https://www.openstreetmap.org/oauth2/applications/new) and register your instance of Level0. It needs permissions for reading user details and modifying the map.
* Open [this link](https://www.openstreetmap.org/oauth2/applications/new) and register
your instance of Level0. It needs permissions for reading user details and modifying the map.
* Create `www/config.php` from `www/config.php.sample`, inserting both OAuth keys.
* Create `data` directory and give writing permissions for it to web server process. Check path in `config.php`. Maybe you'll also need `httpd_sys_rw_content` SELinux tag.
* Check path to document root in `locales/deploy_locales` and run it.
* Create `data` directory and give writing permissions for it to web server process.
Check path in `config.php`. Maybe you'll also need `httpd_sys_rw_content` SELinux tag.

You're set: download some data in the editor and login to OSM.

Oh, one more thing: there will be a lot of `.base` files in the data directory. To clean them, run `crontab -e` and add this line (change path accordingly):
Oh, one more thing: the database would accumulate a lot of obsolete base files.
To clean them, run `crontab -e` for a user that has write permissions to the database,
and add this line (change path accordingly):

0 * * * * find /var/www/level0/data -type f -mtime 1 -delete
0 4 * * * sqlite3 /var/www/level0/data/level0.db "delete from base where created_at < datetime('now', '-1 day'); vacuum;"

## Translation

Localization strings are managed with [Transifex](https://www.transifex.com/projects/p/level0/). There are not many of them, please add a translation for your language when you have time.
Localization strings are managed with [Transifex](https://www.transifex.com/projects/p/level0/).
There are not many of them, please add a translation for your language when you have time.

To update localizations in the code, configure [Transifex CLI](https://developers.transifex.com/docs/cli) and do `tx pull -a`

## Development

Expand Down
Binary file removed locales/de.mo
Binary file not shown.
10 changes: 0 additions & 10 deletions locales/deploy_locales

This file was deleted.

Binary file removed locales/en.mo
Binary file not shown.
Binary file removed locales/es.mo
Binary file not shown.
Binary file removed locales/fr.mo
Binary file not shown.
Binary file removed locales/hr.mo
Binary file not shown.
Binary file removed locales/it.mo
Binary file not shown.
Binary file removed locales/ja.mo
Binary file not shown.
Binary file removed locales/nl.mo
Binary file not shown.
Binary file removed locales/pl.mo
Binary file not shown.
Binary file removed locales/pt_BR.mo
Binary file not shown.
Binary file removed locales/ru.mo
Binary file not shown.
Binary file removed locales/uk.mo
Binary file not shown.
23 changes: 0 additions & 23 deletions locales/update_locales

This file was deleted.

2 changes: 0 additions & 2 deletions locales/update_pot

This file was deleted.

Binary file removed locales/vi.mo
Binary file not shown.
Binary file removed locales/zh_TW.mo
Binary file not shown.
Loading

0 comments on commit 66a099f

Please sign in to comment.