translat using oscar framework

87 views
Skip to first unread message

frank lucky

unread,
Jan 4, 2022, 9:36:22 AM1/4/22
to Django users
hi i use oscar framework for makeing ecoomerce web site  now iwant to translat it  and  
want to add other languges and ii'm working in windows  and in its doc it says


mkdir locale i18n
ln -s $PATH_TO_OSCAR i18n/oscar
./manage.py makemessages --symlinks --locale=de

how i do it in windows  i make  local and i18n forlder in root of peoject but
secound line not working

Kasper Laudrup

unread,
Jan 4, 2022, 11:54:30 AM1/4/22
to django...@googlegroups.com
On 04/01/2022 09.50, frank lucky wrote:
>
> mkdir locale i18n
> ln -s $PATH_TO_OSCAR i18n/oscar
> ./manage.py makemessages --symlinks --locale=de
>
> how i do it in windows  i make  local and i18n forlder in root of
> peoject but
> secound line not working
>

First of all, it is much easier for someone to help you if you describe
the errors you are getting instead of simply writing "not working" and
expect people to guess what that might mean.

It is quite easy to see the issues with that line. In Windows
environment variables, at least in cmd.exe, are accessed with % instead
of $ so you need to change that to %PATH_TO_OSCAR. Of course, that
assumes that you actually have that variable in your environment somehow.

Also, Windows hasn't support symbolic links historically but since
Windows 2000 or so it should be possible to use the "mklink" command
instead of the "ln" Unix command:

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

Not sure it will work though and in general I would really recommend
using pretty much anything other than Windows. It will save you from
tons and tons of frustrations.

Kind regards.

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature

Itinerant Ankit

unread,
Jan 4, 2022, 8:53:40 PM1/4/22
to django...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e724fbde-d349-5e3c-1826-d1d669af157a%40stacktrace.dk.

frank lucky

unread,
Jan 5, 2022, 4:14:28 PM1/5/22
to Django users
hi thanks for you time i  use this

mklink /d %PATH_TO_OSCAR/oscar

but i get this error (oscar) PS C:\Users\faramarz\Desktop\uniqemug-os> mklink /d %PATH_TO_OSCAR/oscar
mklink : The term 'mklink' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ mklink /d %PATH_TO_OSCAR/oscar
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (mklink:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Julio Cojom

unread,
Jan 5, 2022, 4:35:01 PM1/5/22
to django...@googlegroups.com
Hi,

You need to understand what are you doing,

Oscar documentation put it really simple.

First create a directory inside your project called i18n and locale

Then create a symbolic link to Oscar package so manage.py makemessages can find translatable strings. 

For the last step, you need to locate where Django Oscar is inside your hard drive.

One simple way to find python directory is opening a PowerShell or cmd and opening the python console.

import os
import sys
os.path.dirname(sys.executable) 

That gives you the python executable files path.

After navigate to it, go to Lib->site-packages

There you will find all the libraries installed, including django-oscar

Once you have all the data, open a PowerShell or cmd and make the symbolic link, in windows you can use a shortcut just using right click -> create a shortcut, then renaming the shortcut and placing it where documentation mention.

Last, run manage.py makemessages with the flags you need. 

Remember, you're dealing with python not with Django as programming language.

If you don't have idea of what I'm writing, start with a simpler project.

Regards

Julio Cojom


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

frank lucky

unread,
Jan 7, 2022, 5:58:22 PM1/7/22
to Django users
i make the po file and than install Rosetta
and than find
django.mo
and django .po full translated for the language i want and than replaced
it with the file it created with

make message.png
but noting change in site and oscar dasbord


Kasper Laudrup

unread,
Jan 8, 2022, 5:35:31 PM1/8/22
to django...@googlegroups.com
On 07/01/2022 23.58, frank lucky wrote:
> i make the po file and than install Rosetta
> and than find
> django.mo
> and django .po full translated for the language i want and than replaced
> it with the file it created with
>
> make message.png
> but noting change in site and oscar dasbord
>

So you completely ignored the very useful advice you got from Julio
Cojom and tried something else and is now surprised that it doesn't work
and want help with that?

Or is this a completely different issue?

You'll have a much better chance of getting help if you actually respond
to the help you're getting.

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages