From c5737331f01608d7367323065889aa9c46d1dff9 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sat, 6 Jul 2013 16:21:44 +0200 Subject: [PATCH] Better translation docs --- docs/_static/join_team.png | Bin 0 -> 1701 bytes docs/_static/request_language.png | Bin 0 -> 2480 bytes docs/_static/translate_now.png | Bin 0 -> 1970 bytes docs/index.rst | 2 +- docs/internationalization.rst | 80 ++++++++++++++++++++++-------- 5 files changed, 59 insertions(+), 23 deletions(-) create mode 100644 docs/_static/join_team.png create mode 100644 docs/_static/request_language.png create mode 100644 docs/_static/translate_now.png diff --git a/docs/_static/join_team.png b/docs/_static/join_team.png new file mode 100644 index 0000000000000000000000000000000000000000..532c5ff1d7178d447639c423519127cd4a9e3c83 GIT binary patch literal 1701 zcmV;W23q-vP)WPF*z1 zvQ1rF;-ZOLoSN+AX0jJ1)5UCpY>F`FV<~6;qxHR49E?puP9*zxTpzd#Qcg zjAbP~X`0jj{Eu_K`mcE@hU8Ftwu9WUqf<8L5$rgb_0Opn%hbH?-SE#-OokIX&#=U7f+4 zI8+e<&IfFiNGuX0#GrK#ELxQeK@gC*v4gEDh(++ok>z3F@pu9O;+fFA@*N3gqy>$D z7j}_za?rSuieA`-WC_Ymt!;Hp28_Vtw3?*&;h~y`yFPc`U8&ZWovUEhpE`M5+Vn}` z4o67y=YAYHUs>%Lsp9$_48uc;9q!89d1tdbJQweDVUDhDS(N+e81B#noIi_qP-%nx zxLg>^yAucA`7_`3$=BC!-}R%j^TRJ%4DEgtm?3@ry*8sM7|nlM$GvFoypxEJXl!r>Y5e0*kRk=-#2ge%!`%R37l|Y zSYA$MLY$64;fJ5j-mcLb9<)g%lDwRSiSZ*WHv4zQWsNN@0z{CRK5P0^vT9XT*PJ+A z-s$LqS!Fz%Iy?0V5Q68dxzAjNV z6*c<$ZwimUxAirjGxsU<&UgNj6+3U(pfvOWw`p~@R4QifbI>9C5AoLCVQOq@nV*)5 z@DZU%@O)<4`HHJJ;6{^`w&L+-PMg9P@IjcAII_ji#`Z?9hEg_~&H9FW^U`KQU!_DR zr6gD0yaj#jFpVZ!1)VsZ7M05YRyxFtsgKd#65@4ZM?a!gDd1;f!iaXG34@gVkZJeI zJy7)K9kt^EHmkk!p21jkr;gDU359zP9A)y<-hv`IMLBzR-jP`4}m@? zC{fhua@j0)6qS)2qJW2vJW5I{z*=w&4&bc0Q3R%hMxz-Nc7E_V9j?deoHB773|+c* z^Y1HFF6!iD>+Hlaoc0_gmGpW>5R!?M6NDfi9c*4cbY-H#Z3FVB5WSkc+j_VwFq&r*-lUu!p6d;mvf zoXs!gy!CP}9RfP=>F)?eVJpXIRIrIop8Xxiai`OD{O9uNQzlYF(Ao=TZmDOhN@7W{2lAiiU@r=mK zgn^M&X9E!LYIQA}ag?Y1hfCpmV_sIDU;loPbuTRW{@BTFyY`7h!trC1vKP$p<`rX3 zcRas)BP>Xt^=(nfuYX)zxg-m!#F`a3#bsx<@7<4Km;#mMFIzlueDdY0>K%Lbi^bw6 zC#R(J7EqRF@W!2Z?)S#0uGFT)DH%`)q5~Ch$#ZkZP{lD!+l?l3#^glyyH9E{{`tav zy-*FHia~|d4viVODBS1A$&&l|F8FYe*S7Ee3=X2XSs8FvpfgMG=Kotw?)Qq|mjvhA zUE5v{UO!wk{|nxQ3l^cyll%L-P$LaKeK+rTem50OOLhN&pU^@PQpj v2h9Ou;2t(}Yxd&Zz{MMso+G)9`(ynF>^mRWp|LEj00000NkvXXu0mjf{D4rk literal 0 HcmV?d00001 diff --git a/docs/_static/request_language.png b/docs/_static/request_language.png new file mode 100644 index 0000000000000000000000000000000000000000..536d0785c7cab4b7ffd8008bedc0d22bcdef8766 GIT binary patch literal 2480 zcmV;h2~YNkP)gS}y4xmGS&1Og%=ir@jQu$alJ5s#2y+FGi~ zq>Y`JaWZX9+e{}%r|rbnX_HhZwZBsIeq3yv1sLOzrWg4dK%o%w7b-RPRJQE_wVtfX5?K;k0^E^YITSSTGe% z_iZs4O-=3H_xgrp3KfDweAtZW@Q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V^#C`}4;`b85+KW>05d+b>n;`i6T;>hiRsno#$s zxiamiS&IV^sMa%CM&;LjY{mRwWL&$FE`n&M2A2eFE=q7|DNBYGMkAHII0s;bvXiG~= z2Ek_4s#U!55#7g+ACHTR>+I~jckf|G4I%Q{Pw`b2DIdeVjca8?cn*Q%jLupxkao=#y&z0Y`_BKKM zPiOVD+V2H6W@f6y@N}>t9`XBBR(MbLy5~A9UUPf!(P35MQS1uCe&N}3tPF8 zQ$;@?|Hv4^0zJ2E*-~F$4G@lF*Ya&O$YK_0AIw~mS@5$oqB@P-CH-QC?Zs63LAJv}|} zk=rs=G(TWMPvOP&P=YjFSglyGf&yDxTT7%82kY0b&(F`NOAZlpPEJmerII*Z4TFyc z0gfS`f1Gixc4D(xY-#sJWVYuLUy}Fzu@T`T)WQ*>6wqyGXvoXUi;s`b%F3cHUAlCM zeT8x1O_3b(wIUt?21Hp%6cgr>>j`IF+(Zo&tb}Lx@83^l6DkoCBE}`hO%=Ul$r5JS zH30)YH0bh68k|w1rltlCYu2oxyK?19upx({qoc8uPZu7O#tq9JvDn8UFgf&Vj%q`i z0S9ZxFQX2)+IfJ@`%BfM91+JXK}T$oMjU@h6g~9VOg$kgDd><(;H)r%zKrVq#)AILK%9aAT_j_%mnDJb3T`L^Conhza)goSYoa zDFPcwt7%0u$jui>E?>UPsgDL3PpQNew7D~Y6WIeisL|WoOF)RtRql;B)UjP6A07*qoM6N<$ Ef^?j?GXMYp literal 0 HcmV?d00001 diff --git a/docs/index.rst b/docs/index.rst index e20f701..10f569a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -63,8 +63,8 @@ Content installation contributing design - tutorial internationalization + tutorial Reference ----------- diff --git a/docs/internationalization.rst b/docs/internationalization.rst index f904dd2..0b33eb9 100644 --- a/docs/internationalization.rst +++ b/docs/internationalization.rst @@ -4,13 +4,12 @@ Internationalization and localization .. index:: internationalization -Refer to the `Django i18n documentation`_ to get started. - -.. _`Django i18n documentation`: https://docs.djangoproject.com/en/dev/topics/i18n/ +Refer to the `Django i18n documentation`_ to get started with +internationalization (i18n). -Using internationalization in your project -========================================== +Enabling i18n in Django +======================= Make sure you've activated translation for your project (the fastest way is to check in your ``settings.py`` file if ``MIDDLEWARE_CLASSES`` includes @@ -22,35 +21,62 @@ Then compile the messages so they can be used by Django. python manage.py compilemessages - It should get you started ! -Contributing to localization -============================ -Django-admin2 has adopted `Transifex`_ to manage the localization process, `join and -help us`_ making django-admin2 available for everyone ! +Translating django-admin2 +========================= -.. _Transifex: https://www.transifex.com -.. _`join and help us`: https://www.transifex.com/projects/p/django-admin2/ +The translation of the language files is handled using Transifex_. + +Improving existing translations +------------------------------- + +To check out what languages are currently being worked on, check out the +`Project page`_. If you want to help with one of the translations, open the +team page by clicking on the language and request to join the team. + +.. image:: _static/join_team.png + :alt: Button labeled "Join team" + +Now you can start translating. Open the language page, select a language +resource (e.g. *djadmin2.po*). + +.. image:: _static/translate_now.png + :alt: Button labeled "Translate now" + +Then select a string from the list on the left and enter a translation on the +right side. Finally, click the *Save* button on the top right and you're done. + +It is also possible to suggest better translations for existing ones with the +*Suggest* button on the bottom. + +Requesting a new language +------------------------- + +If a language is not available on Transifex_ yet, you can request it with the +*Request language* button on the `Project page`_. + +.. image:: _static/request_language.png + :alt: Button labeled "Request language" -Using internationalization in the django-admin2 project development -=================================================================== +Using i18n in the django-admin2 project development +=================================================== -Internationalization --------------------- +This section is mainly directed at -Python code -########### +Marking strings for translation +------------------------------- + +**Python code** Make sure to use ugettext or ugettext_lazy on strings that will be shown to the users, with string interpolation ( "%(name_of_variable)s" instead of "%s" ) where needed. Remember that all languages do not use the same word order, so try to provide flexible strings to translate ! -Templates -######### +**Templates** Make sure to load the i18n tags and put ``trans`` tags and ``blocktrans`` blocks where needed. @@ -72,12 +98,22 @@ Update the headers of the newly created file to match existing files and start t Updating existing locales ------------------------- +To update the language files with new strings in your .py files / templates: + .. code-block:: bash cd djadmin2 # or any other package, for instance example/blog django-admin.py makemessages -a - # update the translations - # make sure to fix all fuzzy translations +Then translate the files directly or upload them to Transifex_. + +When the translation is done, you need to recompile the new translations: + +.. code-block:: bash django-admin.py compilemessages + + +.. _`django i18n documentation`: https://docs.djangoproject.com/en/dev/topics/i18n/ +.. _transifex: https://www.transifex.com/projects/p/django-admin2/ +.. _project page: https://www.transifex.com/projects/p/django-admin2/