shuup icon indicating copy to clipboard operation
shuup copied to clipboard

multi lingual forms not showing fields

Open keinagae opened this issue 5 years ago • 8 comments

i have installed shuup but for some reason its not showing me any field related to multi languages like name or slug field in product type creation Screenshot 2020-09-19 222223

Screenshot 2020-09-19 211643 any idea? and is it possible to turn multi language feature of as in many case it work for once and then gives error that translation does not exist

keinagae avatar Sep 19 '20 16:09 keinagae

This is a weird issue, can you share more information about your setup and Shuup installation?

ruohola avatar Jan 05 '21 11:01 ruohola

like my settings file?

keinagae avatar Jan 08 '21 17:01 keinagae

like my settings file?

Yes, and your shuup version etc. The more information the better.

ruohola avatar Jan 11 '21 07:01 ruohola

ok

keinagae avatar Jan 11 '21 08:01 keinagae

import os
from unipath import Path
from decouple import config,Csv
from dj_database_url import parse as db_url

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = Path(__file__).parent

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config('SECRET_KEY', default='$%y+iozyx2(#w7l-c)p_b0tl3epurhjufdzzv1vb8qx9)_))u$')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config("DEBUG",True)

ALLOWED_HOSTS = config("ALLOWED_HOSTS",default="127.0.0.1,localhost",cast=Csv())

# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'easy_thumbnails',
    'shuup.themes.classic_gray',
    'shuup.xtheme',
    'filer',
    'bootstrap3',
    'shuup.core',
    'shuup.discounts',
    'shuup.front',
    'registration',
    'shuup.front.apps.auth',
    'shuup.front.apps.registration',
    'shuup.front.apps.customer_information',
    'shuup.front.apps.personal_order_history',
    'shuup.front.apps.simple_order_notification',
    'shuup.front.apps.simple_search',
    'shuup.front.apps.recently_viewed_products',
    'shuup.admin',
    'shuup.addons',
    'shuup.campaigns',
    'shuup.customer_group_pricing',
    'shuup.guide',
    'shuup.notify',
    'shuup.order_printouts',
    'shuup.simple_cms',
    'shuup.simple_supplier'
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'shuup.front.middleware.ProblemMiddleware',
    'shuup.core.middleware.ShuupMiddleware',
    'shuup.front.middleware.ShuupFrontMiddleware',
    'shuup.xtheme.middleware.XthemeMiddleware',
    'shuup.admin.middleware.ShuupAdminMiddleware'
]
LANGUAGE_CHOICES = [
    ('en', 'English'),
('fi', 'Finnish'),
]
PARLER_DEFAULT_LANGUAGE_CODE = config('PARLER_DEFAULT_LANGUAGE_CODE', default='en')
LANGUAGES = [(code, name) for code, name in LANGUAGE_CHOICES]
PARLER_LANGUAGES = {
    None: [{'code': c, 'name': n} for (c, n) in LANGUAGES],
    'default': {'hide_untranslated': False}
}
PARLER_LANGUAGES = {
    None: [{'code': c, 'name': n} for (c, n) in LANGUAGES],
    'default': {'hide_untranslated': False}
}

ROOT_URLCONF = 'mybooks.urls'

_TEMPLATE_CONTEXT_PROCESSORS = [
    "django.contrib.auth.context_processors.auth",
    "django.template.context_processors.debug",
    "django.template.context_processors.i18n",
    "django.template.context_processors.media",
    "django.template.context_processors.static",
    "django.template.context_processors.request",
    "django.template.context_processors.tz",
    "django.contrib.messages.context_processors.messages"
]

TEMPLATES = [
    {
        "BACKEND": "django_jinja.backend.Jinja2",
        "APP_DIRS": True,
        "OPTIONS": {
            "match_extension": ".jinja",
            "context_processors": _TEMPLATE_CONTEXT_PROCESSORS,
            "newstyle_gettext": True,
            "environment": "shuup.xtheme.engine.XthemeEnvironment",
        },
        "NAME": "jinja2",
    },
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

REST_FRAMEWORK = {
    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.BasicAuthentication',
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
    ),
    'DEFAULT_PERMISSION_CLASSES': (
        'shuup.api.permissions.ShuupAPIPermission',
    )
}

WSGI_APPLICATION = 'mybooks.wsgi.application'

# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases

DATABASES = {
    'default':
        config("DATABASE",
               default='sqlite:///' + BASE_DIR.child('db.sqlite3'),
               cast=db_url
               )

}

# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]

# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/

STATIC_URL = '/static/'
MEDIA_URL = config('MEDIA_URL', default='/media/')

MEDIA_ROOT = config('MEDIA_LOCATION', default=BASE_DIR.child('media'))
STATIC_ROOT = config('STATIC_LOCATION', default=BASE_DIR.child('static_root'))

EMAIL_HOST = config('EMAIL_HOST', default='localhost')
EMAIL_PORT = config('EMAIL_PORT', default=25, cast=int)
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD', default='')
EMAIL_HOST_USER = config('EMAIL_HOST_USER', default='')
EMAIL_USE_TLS = config('EMAIL_USE_TLS', default=False, cast=bool)

keinagae avatar Jan 11 '21 17:01 keinagae

and this is env file ` ALLOWED_HOSTS=example.com DATABASE_ENGINE=mysql_cymysql DATABASE_NAME= DATABASE_USER= DATABASE_PWD= DATABASE_HOST=127.0.0.1 DATABASE_PORT=3306 DEBUG=1 LANG=C.UTF-8 LANGUAGE_CODE=en LANGUAGES=en PARLER_DEFAULT_LANGUAGE_CODE=en SECRET_KEY=$%y+iozyx2(#w7l-c)p_b0tl3epurhjufdzzv1vb8qx9)_))u$ SHOP_CURRENCY=

keinagae avatar Jan 11 '21 17:01 keinagae

and for shuup version i am using 2.1.8

keinagae avatar Jan 11 '21 17:01 keinagae

@keinagae keep on trying it out . all gonna be alright

Nzamuyejoram avatar Sep 22 '21 14:09 Nzamuyejoram