question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems following the guideline for translations

See original GitHub issue

I’ve checked the guideline on this package to make the translations and I don’t know if I’m doing something wrong or maybe the guidelines are outdated (because they are from 2015).

I could make the point 1 and point 2, but when trying to make the point 3. Add translation, when running the makemigrations command I get the following message:

No changes detected in app 'termsandconditions'

I attach my code blocks related to this implementation:

settings.py

LANGUAGES = (
    ('en', _('English')),
    ('es', _('Spanish')),
)

MIGRATION_MODULES = {
    # local path for migration for the termsandconditions
    'termsandconditions': 'ToS_translations.migrations.migrations_termsandconditions',
}

translation.py

from modeltranslation.translator import translator, TranslationOptions
from termsandconditions.models import TermsAndConditions


class TermsAndConditionsTranslationOptions(TranslationOptions):
    fields = ('name', 'text', 'info')


translator.register(TermsAndConditions, TermsAndConditionsTranslationOptions)

The structure of my project

-my_project
  - my_project
     - settings.py
     - ...
  - ToS_translations
     - migrations
         - migrations_termsandconditions
             - 001_initial.py
             - __init__.py
         - __init__.py
     - __init__.py
     - translation.py
  - other_apps

Thank you.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cyfacecommented, Aug 24, 2020

@goromachine Ah! You need to use this setting:

TERMS_EXCLUDE_URL_CONTAINS_LIST = ( {} ) # Useful if you are using internationalization and your URLs could change per language

And add /terms/ to that list, so that it excludes URLs that contain /terms/ from the redirect.

I’ll add that to the docs!

1reaction
cyfacecommented, Aug 21, 2020

Hello! You just need to add both modeltranslation and in your case ToS_translations to your INSTALLED_APPS and that should get you going. I am adding a note to the README to that effect. 👍🏻 Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Toolkit for Making Written Material Clear and Effective - CMS
Common problems with the quality of translated documents ...................3. Figure 11-b. Step-by-step guidelines for translating written materials .
Read more >
Evaluating Translations as Scholarship: Guidelines for Peer ...
The guidelines that follow are intended to help departments and institutions ... light on the translation challenges involved and on the solutions adopted?...
Read more >
Back-Translation Guidelines | University of North Dakota
Back-Translation Guidelines. Introduction. Translation from one language to another is a fairly complicated exercise. There are obstacles associated with 1) ...
Read more >
Guidelines for developing, translating, and validating a ... - NCBI
Translating a Questionnaire. The following section summarizes the guidelines for translating a questionnaire into a different language.
Read more >
Guidelines for Translation of ACA Literature and Materials
Suggestions for Overcoming Difficulties ... The translated manuscript must include the following ... Translate the Translation Guidelines &Workflow.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found