mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
Makefile, settings: Use full paths in pot files
- As reported on IRC, links to source code files in Weblate are broken. This is due to incorrect paths to files inside the POT file. Instead of plinth/views.py it contains views.py. This might be a regression introduced when switching to Makefile for all build tasks. - To fix, we need to run 'django-admin makemessages' command at the topic level directory in the source code repository. However, running at the top-level has problems: - Various unnecessary directories are considered. This was remedied using --ignore aruments. - The default locales directory was not being detected. This was remedied using LOCALE_PATHS in Django settings. - Django settings file was not being picked up. This was remedied using --settings option. - Django settings were being picked up from system's module path. This was remedied using --pythonpath . option. Tests: - Running 'make update-translations' updates all the files. Newly generated POT file contains plinth/ in the file paths. All locales were updated. There are no other major changes POT or language files (other than what seemed to be pending updates). - Running freedombox-develop, locale can be changed to Spanish. The changed locale is visible in UI. Changes to .po file are reflected in the UI after running 'django-admin compilemessages'. - After running freedombox using plinth.service systemd unit, locale can be changed to Spanish. The changed locale is visible in UI. Changes to .po file are reflected in the UI after running 'make build install'. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
6efb0681fc
commit
cc347258b5
6
Makefile
6
Makefile
@ -58,7 +58,11 @@ ROOT_DATA_FILES := $(shell find data -type f $(FIND_ARGS))
|
||||
MODULE_DATA_FILES := $(shell find $(wildcard plinth/modules/*/data) -type f $(FIND_ARGS))
|
||||
|
||||
update-translations:
|
||||
cd plinth; $(DJANGO_ADMIN) makemessages --all --domain django --keep-pot --verbosity=1
|
||||
$(DJANGO_ADMIN) makemessages --all --domain django --keep-pot \
|
||||
--verbosity=1 --ignore conftest.py --ignore doc --ignore build \
|
||||
--ignore htmlcov --ignore screenshots --ignore debian --ignore \
|
||||
actions --ignore preseed --ignore static --ignore data \
|
||||
--settings plinth.settings --pythonpath .
|
||||
|
||||
configure:
|
||||
# Nothing to do
|
||||
|
||||
@ -135,6 +135,9 @@ IPWARE_META_PRECEDENCE_ORDER = ('REMOTE_ADDR', )
|
||||
# Overridden by get_languages()
|
||||
LANGUAGES = [('en', 'English')]
|
||||
|
||||
# A list of directories where Django looks for translation files.
|
||||
LOCALE_PATHS = ['plinth/locale']
|
||||
|
||||
# Overridden by log configuration in log.py
|
||||
LOGGING = {'version': 1}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user