Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

implementing trial for text translation on templates #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vinyll
Copy link
Member

@vinyll vinyll commented Jun 2, 2017

Added a sample translation for the title.
Note that you need to setup a csv file and adapt your settings.py

@vinyll vinyll self-assigned this Jun 2, 2017
@vinyll vinyll requested a review from Ydrasil June 2, 2017 15:58
def get_translations_file():
supported_languages = app.config.get('TRANSLATION_FILES').keys()
lang = (request.accept_languages.best_match(supported_languages) or
supported_languages[0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure that we'll always have at least 1 language in app.config.get('TRANSLATION_FILES').keys() ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. We should in most cases, but indeed the system should still work if the translation were not found.

from tcii18n.template import flask_methods

import gfm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure but gfm import have to be with flask and tcii18n import or not ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's correct, it should be above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants