-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add internationalisation support #98
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some minor decisions and concern about use of server_default
vs. default
for the field definition
invenio_pages/records/models.py
Outdated
@@ -36,6 +37,9 @@ class PageModel(db.Model, Timestamp): | |||
title = db.Column(db.String(200), nullable=False, default="") | |||
"""Page title.""" | |||
|
|||
lang = db.Column(db.String(2), nullable=False, default="en") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor/question: (probably I18N/L10N experts can jump in) is this the best format to store the language? E.g. could en-US
or similar be better and map to the overall translations process? This would affect the string size, i.e. 2 vs. 5 (or even higher?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an expert but this is the information the UI provides?! This follows the settings in I18N_LANGUAGES
.
Co-authored-by: Alex Ioannidis <[email protected]>
Co-authored-by: Alex Ioannidis <[email protected]>
…hanges. This makes the alembic tests run, too!
Merged with using |
❤️ Thank you for your contribution!
Description
Add internationalisation support. By adding a lang column and extendig the unique constraint the goal is achieved. This feature is available in the Administration interface as well.
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: