Why Django Rosetta doesn't translate everything? There are some string missing

658 Views Asked by At

I am using Django Rosetta v 0.7.6 (to match with libraries and Django version to make it work the web-app). It translates from en-us to ar(Arabic), and it works in almost everything but some strings are missing and I cannot find what is wrong and why are not being translated all of them.

This is the part of the languages in the settings.py document and the locale path in case something should be changed (or in different order as should be):

 TEMPLATE_DIRS = (os.path.join(PACKAGE_ROOT, 'templates'),os.path.join(PACKAGE_ROOT, 'templatetags')) + TEMPLATE_DIRS
LOCALE_PATHS = (os.path.join(PACKAGE_ROOT, '../locale'),)

    # If the rosetta library has been installed, and add to INSTALLED_APPS
try:
    import rosetta
    INSTALLED_APPS += ('rosetta',)
except ImportError:
    pass


ugettext = lambda s: s
LANGUAGES = (
             ('en-us', ugettext('English')),
             ('ar', ugettext('Arabic')) #Your second language
             )
LANGUAGE_CODE = 'en-us' #Your default language
USE_L10N = True

The .po document generates in the beginning this lines with the fuzzy and the empty string and after that some mambo jumbo about the version year dates ... and then the whole list with the relation between the document translated the strings and the two languages(#: documet/translated/form.htm:1234, msgid "String in en-us" msgstr "string in ar").

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""`

In the whole document of .po just are missing those not translated in the page, but neither appear any mention to the original string in en-us, so I guess that is not even trying to translate them because they are not there in the .po document.

In the next picture are the logs of those lines, files... untranslated. And later the section of the code .htm for the first form in the django Rosetta page that is not translated and shown in the picture.

enter image description here

    {% extends "views/forms/base.htm" %}
{% load i18n %}

{% block form_content %}
<!-- Resource Type CRUD Form -->
<hr class="divider arches-RDM-divider">

<div id="site_ID-section">
    <!-- Name CRUD Form -->
    <div class="row">
        <div class="col-xs-12">
            <div class="padding-left-10">
                
                <dl>
                    <!-- Title -->
                    <dt>
                        <h5 id="arches-names-form" class="section-headline">{% trans "National ID" %}</h5>
                    </dt>
                    
                    <!-- Form -->
                    <dd>
                        <div class="row">
                            
                            <div class="col-xs-12 hidden-xs">
                                
                                <input class="form-control arches-form-input" id="resource-name" style="width: 18%;" placeholder='{% trans "National ID" %}' data-bind='value: getEditedNode("SITE_ID.E42", "value")'>
                                    
                                    
                                    {% include 'views/components/add-item-button.htm' %}
                                    
                                    </div>
                            
                            <div class="col-xs-12 hidden-sm hidden-md hidden-lg">
                                
                                <input class="form-control arches-form-input" id="resource-name" style="width: 33%;" placeholder='{% trans "National ID" %}' data-bind='value: getEditedNode("SITE_ID.E42", "value")'>
                                    <div class="margin-top-5"></div>
                                    >
                                    
                                    <!-- Spacer (for xs screens) -->
                                    <div class="margin-top-5"></div>
                                    
                                    {% include 'views/components/add-item-button.htm' %}
                                    
                            </div>
                            
                            
                        </div>
                    </dd>
                    <!-- End Form -->
                    
                </dl>
                
            </div>
        </div>
    </div>
    <!-- End Name CRUD Form Container -->
    
    <!-- Name Records -->
    <div class="row">
        <div class="col-xs-12">
            
            <!--  -->
            <div class="arches-crud-child-section">
                <dl>
                    <dd class="arches-CRUD-child-title">
                        {% trans "This resource has the following ID code:" %}
                    </dd>
                    
                    <dd class="margin-left-5" style="display: none;" data-bind="visible: true">
                        <div data-bind="visible: getBranchLists().length == 0" class="txt-color-blue">{% trans "No ID Defined" %}</div>
                        
                        <div data-bind='foreach: getBranchLists()'>
                            <div class="arches-crud-record">
                                <a href="javascript:void(0)" class="arches-CRUD-child" title="{% trans "Delete this name" %}"><i data-bind="click: $parent.deleteItem.bind($parent)" class="arches-CRUD-delete fa fa-times-circle"></i></a>
                                <a href="javascript:void(0)" class="arches-CRUD-child arches-CRUD-edit" data-bind="click: $parent.editItem.bind($parent)" title="{% trans "Edit this name" %}"><span data-bind='text: nodes.get("SITE_ID.E42", "value")' style="padding-right:2px;"></span><span class="text-muted arches-crud-type-identifier"></span>
                                </a>
                            </div>
                        </div>
                    </dd>
                    
                </dl>
            </div>
        </div>
    </div>

Please in here is how it looks when translate and in original language, just in case it helps to localise what is wrong, I have reboot the instance and also the server but same answer after did this:

In en-us

In Arabic

0

There are 0 best solutions below