페이지가 원하는 국제화로 라우팅되도록 구성되었으므로 이제는 현지화를 직접 제공해야합니다. 자동으로 번역되지는 않습니다. 당신이 직접 처리해야합니다. 그래서 당신은
from django.utils.translation import ugettext as _
지금 당신은 다음과 같은 방법으로 ugettext as _
를 사용하여 번역해야 할 텍스트를 표시하여 번역해야하는 요소를 표시해야합니다 수행합니다 -
class PollPluginPublisher(CMSPluginBase):
model = PollPluginModel # model where plugin data are saved
module = _("Polls")
name = _("Poll Plugin") # name of the plugin in the interface
이제 요소 ("설문 조사")와 번역 설문 ("설문 조사 플러그인")이 표시됩니다. 이 처리 후에는 루트 디렉토리에서 다음 명령을 실행할 수 있습니다 -
django-admin makemessages -l de
는 "드"지난 언어 로케일 이름으로 교체합니다. 이 명령이 수행하는 작업은 변환해야하는 요소를 저장하는 po 파일을 작성한다는 것입니다. LOCALE_PATH
이 올바르게 설정되어 있는지 확인하십시오. 이것이 당신이 번역에 대해 다음 장고 - 패키지를 사용할 수 있습니다 완료 후
: -
1) django-rosetta :- https://django-rosetta.readthedocs.io/en/latest/
2) django-modeltranslation:- http://django-modeltranslation.readthedocs.io/en/latest/
을 LOCALIZATION 더 참고하면 볼 수 있습니다 : -
https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#localization-how-to-create-language-files
당신은 118N으로 당신의 urlpatterns을 확인 했 ? 그리고 URL (r '^ accounts /', include ('allauth.urls'))은 어디에 있습니까? –
@ShashishekharHasabnis 조언에 감사드립니다. 귀하의 조언을 참조하고 다음과 같은 URL 코드를 편집하십시오 : https://gist.github.com/rightx2/7a15208cb24e4c88b6c23a67b4543964. 그리고 내가 싱글 페이지에 접속하면 url은 다음과 같이 나타납니다 : http : // localhost : 8000/ko-kr/accounts/login/그러나 여전히 언어는 영어입니다. (다른 페이지도 영어로되어 있습니다) – user3595632