Giter Site home page Giter Site logo

django-translation-manager's People

Contributors

cisarpavel avatar dingosaurus avatar gpavlovichhtec avatar hansek avatar jalohse avatar jancespivo avatar jhavej avatar krakenus avatar michalkaspar avatar mikulas-mrva avatar rafael-h-ferreira avatar rammt avatar visgean avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-translation-manager's Issues

Translation manager doesn't appear in admin on production.

Locally all works ok. But when I uploaded all changes in server it's doesn't work.

On server I did migration, check in database new tables was created and loaded strings from po files via shell.

from translation_manager.manager import Manager

m = Manager()
m.load_data_from_po()
# processing pofile /home/ubuntu/project/path/locale/en/LC_MESSAGES/django.po

Then in shell I checked if it register in admin.

from django.contrib import admin
admin.site._registry
# <class 'translation_manager.models.TranslationEntry'>: <translation_manager.admin.TranslationEntryAdmin object at 0x7f8e2089f9b0>,
# <class 'translation_manager.models.TranslationBackup'>: <translation_manager.admin.TranslationBackupAdmin object at 0x7f8e2089f9e8>

Even no link to translations in urls
http://my_site/admin/translation_manager/ - 404

List of translated texts is not displayed on the admin site.

When I access the admin site after making various settings according to the home page (https://www.coex.cz/blog/translation-manager), the screen displaying the string data to be translated does not appear as shown below.

image

My screen looks like the following, with no data to be translated.
The django.po file has been generated.

image

Also, when I try to add translation data, the following screen appears, and I can only enter the "Admin-translation_entry-original-label:" part.

image

Do you know the solution to this problem?

My environment is as follows.
django:ver3.2.3
db:sqlitedb
os:windows10

Broken migration

Na branchi feature/remote_sync způsobuje migrace 0006_auto_20170915_1529 error:
TypeError: 'class Meta' got invalid attribute(s): indexes

Pomohlo odstranění řádku 22.

Rename the post_save signal

The translation_manager.signals.post_save is sent when the translations are published. It would be better to call it post_publish for example.

[Errno 2] No such file or directory: 'locale/de/LC_MESSAGES/django.po'

this happens, when translation strings are imported through the db but the locale directory structure is not there yet. Example: Import DB from a production system to a local system and then click on 'publish translations'.

I would expect this to work as it works when I create the /locale directory structure without the *.po files. In this case the *.po files are correctly written.

No module named policy

I just installed this package on a project running on python 2.7 and django 1.11, and I receive the following error:

File "/home/arexons/projects/arexons/arexons_dev/local/lib/python2.7/site-packages/translation_manager/admin.py", line 1, in <module>
    from email.policy import HTTP
ImportError: No module named policy

Restore does not work in Python 3

When trying to restore a backup in version 1.1.1 with Python 3, the following happens:

with open(po_filename, 'w') as output:
    output.write(self.content.encode('utf-8'))
TypeError: write() argument must be str, not bytes

Support for jsx-files

An option to enable jsx-file parsing for the djangojs domain would be very helpful.

Issue with load_data_from_po() with MySQL database

OperationalError: (1093, "You can't specify target table 'translation_manager_translationentry' for update in FROM clause")

caused by: TranslationEntry.objects.filter(original__in=published.values_list('original', flat=True)).update(is_published=True)

MySQL doesn't allow updating the table you are already using in an inner select as the update criteria.
Fix is to wrap published values in list:
TranslationEntry.objects.filter(original__in=list(published.values_list('original', flat=True))).update(is_published=True)

missing migrations in translation-manager

I'm using 1.1.1 with python3.8 and django 3.0.4.

# Generated by Django 3.0.4 on 2020-03-24 10:55

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('translation_manager', '0008_auto_20200120_1735'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='translationbackup',
            options={'ordering': ('-created',), 'verbose_name': 'Admin-translation_backup-singular', 'verbose_name_plural': 'Admin-translation_backup-plural'},
        ),
        migrations.AlterModelOptions(
            name='translationentry',
            options={'ordering': ('original',), 'permissions': (('load', 'admin-translation_entry-load-from-po'),), 'verbose_name': 'Admin-translation_entry-singular', 'verbose_name_plural': 'Admin-translation_entry-plural'},
        ),
    ]

Django 4.0 Support

ugettext_lazy is removed in Django 4.0 and should be replaced with gettext_lazy

django.conf.urls.patterns is deprecated in Django 1.10

I have not performed a full test yet, but following changes seems to fix a startup error when running in Django 1.10

translation_manager/admin.py (function get_urls):

  1. before:
    def get_urls(self):
        try:
            from django.conf.urls import patterns, url

after:

    def get_urls(self):
        try:
            from django.conf.urls import url
  1. before:
        urls = patterns('',
            url(r'^make/$', wrap(self.make_translations_view), name='%s_%s_make' % info),
            url(r'^compile/$', wrap(self.compile_translations_view), name='%s_%s_compile' % info),
            url(r'^load_from_po/$', wrap(self.load_from_po_view), name='%s_%s_load' % info),
        )

after:

        urls = [
            url(r'^make/$', wrap(self.make_translations_view), name='%s_%s_make' % info),
            url(r'^compile/$', wrap(self.compile_translations_view), name='%s_%s_compile' % info),
            url(r'^load_from_po/$', wrap(self.load_from_po_view), name='%s_%s_load' % info),
        ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.