How regularly is the archive with translations in crowdin updates?

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by Evgeniy »

kisolre wrote: Sun Sep 12, 2021 11:47 am Not to be ungrateful but my idea was more like a full automation of downloading all ts files for selected language one by one and converting to qm.
Macro is ready but it need Crowdin API token.

The macro works as fast as possible. It download ~20 files and convert it at ~10 seconds.

Link: https://github.com/FreeCAD-Tools/Crowdi ... ns.FCMacro
kisolre
Veteran
Posts: 4164
Joined: Wed Nov 21, 2018 1:13 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by kisolre »

Nice touch with the parameter creation :)
But when I run the script I get:

Code: Select all

21:46:43  Traceback (most recent call last):
  File "C:/Users/Wivern/AppData/Roaming/FreeCAD/Macro/CrowdinUpdateTranslations.FCMacro", line 7, in <module>
    import json, requests, os, subprocess
  File "E:\FC_DevVMBuild\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
<class 'ModuleNotFoundError'>: No module named 'requests'
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by Evgeniy »

kisolre wrote: Sun Sep 19, 2021 6:48 pm Nice touch with the parameter creation :)
But when I run the script I get:

Code: Select all

21:46:43  Traceback (most recent call last):
  File "C:/Users/Wivern/AppData/Roaming/FreeCAD/Macro/CrowdinUpdateTranslations.FCMacro", line 7, in <module>
    import json, requests, os, subprocess
  File "E:\FC_DevVMBuild\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
<class 'ModuleNotFoundError'>: No module named 'requests'
You use LP or Conda Windows build?

Я думаю это связано с тем, что LP сборка под Windows укорочена по размеру и не содержит в себе модуль request.
Last edited by Evgeniy on Mon Sep 20, 2021 7:58 am, edited 1 time in total.
kisolre
Veteran
Posts: 4164
Joined: Wed Nov 21, 2018 1:13 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by kisolre »

Evgeniy wrote: Sun Sep 19, 2021 7:11 pm You use LP or Conda Windows build?
My own LP build. Weekly builds are way behind lately :) I could run a Conda version just for that script but it still does not have the Bulgarian language included so gives this:

Code: Select all

06:11:50  Traceback (most recent call last):
  File "C:/Users/Wivern/AppData/Roaming/FreeCAD/Macro/CrowdinUpdateTranslations.FCMacro", line 86, in <module>
    locale = Gui.supportedLocales()[Gui.getLocale()]
<class 'KeyError'>: ('Bulgarian',)
OS: Windows 8.1 (6.3)
Word size of FreeCAD: 64-bit
Version: 0.20.25645 (Git)
Build type: Release
Branch: master
Hash: 37d9757399b4c2ec30318eb88d7cd7c508246345
Python version: 3.8.10
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: Bulgarian/Bulgaria (bg_BG)
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by Evgeniy »

kisolre wrote: Mon Sep 20, 2021 3:13 am My own LP build. Weekly builds are way behind lately :) I could run a Conda version just for that script but it still does not have the Bulgarian language
Script updated. I test it on LP build and it works fine.

https://github.com/FreeCAD-Tools/Crowdi ... ns.FCMacro
kisolre
Veteran
Posts: 4164
Joined: Wed Nov 21, 2018 1:13 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by kisolre »

Evgeniy wrote: Mon Sep 20, 2021 7:55 am Script updated.
It works. Thanks for all your efforts :D
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by Evgeniy »

kisolre wrote: Mon Sep 20, 2021 9:36 am It works. Thanks for all your efforts :D
Я обновил скрипт. Теперь необязательно перезагружать FreeCAD, большинство строк обновляется сразу после скачивания, но не все. Чтобы обновить тексты которые не обновились нужно например: закрыть открытый диалог и открыть его снова, чтобы строки обновились.

Возможно для обновления каких-то строк все еще требуется перезагрузка.

I updated the script. Now it is not necessary to restart FreeCAD, most lines are updated immediately after downloading, but not all. To update texts that have not been updated, for example: close the opened dialogs and open it again so that the lines are updated.

It is possible that a reboot is still required to update some lines.
kisolre
Veteran
Posts: 4164
Joined: Wed Nov 21, 2018 1:13 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by kisolre »

Evgeniy wrote: Wed Sep 22, 2021 12:47 pm I updated the script.
Tried to translate some things and then wanted to update using the latest version of the script but I get this error (token shorted):

Code: Select all

23:37:49  Youre locale is: 'bg'
23:37:49  try to get file list from: https://crowdin.com/api/v2/projects/286/files?limit=250
23:37:49  Traceback (most recent call last):
  File "C:/Users/Wivern/AppData/Roaming/FreeCAD/Macro/CrowdinUpdateTranslations.FCMacro", line 98, in <module>
    resp = request.urlopen(req)
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 1393, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 1350, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "E:\FC_DevVMBuild\bin\lib\http\client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "E:\FC_DevVMBuild\bin\lib\http\client.py", line 1296, in _send_request
    self.putheader(hdr, value)
  File "E:\FC_DevVMBuild\bin\lib\http\client.py", line 1233, in putheader
    raise ValueError('Invalid header value %r' % (values[i],))
<class 'ValueError'>: Invalid header value b'Bearer 608XXXXX225d9\n'
Could it be some error at my end, internet limitations, recent changes in FreeCAD? I use self compiled build from today.

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.26311 (Git)
Build type: Release
Branch: master
Hash: 4543c982670a0d6044ebed7812ac7df43feb1c4a
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Bulgarian/Bulgaria (bg_BG)
kisolre
Veteran
Posts: 4164
Joined: Wed Nov 21, 2018 1:13 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by kisolre »

Anyone else can take a look at that error? Could be something stupid on my side, network limitations/filtering in Myanmar, ...
kisolre
Veteran
Posts: 4164
Joined: Wed Nov 21, 2018 1:13 pm

Re: How regularly is the archive with translations in crowdin updates?

Post by kisolre »

I continue getting this errors when trying to run the script:

Code: Select all

20:47:49  Youre locale is: 'bg'
20:47:49  try to get file list from: https://crowdin.com/api/v2/projects/286/files?limit=250
20:47:49  Traceback (most recent call last):
  File "C:/Users/Wivern/AppData/Roaming/FreeCAD/Macro/CrowdinUpdateTranslations.FCMacro", line 98, in <module>
    resp = request.urlopen(req)
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 1393, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "E:\FC_DevVMBuild\bin\lib\urllib\request.py", line 1350, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "E:\FC_DevVMBuild\bin\lib\http\client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "E:\FC_DevVMBuild\bin\lib\http\client.py", line 1296, in _send_request
    self.putheader(hdr, value)
  File "E:\FC_DevVMBuild\bin\lib\http\client.py", line 1233, in putheader
    raise ValueError('Invalid header value %r' % (values[i],))
<class 'ValueError'>: Invalid header value b'Bearer 608ac
Evgeniy wrote:Ping
chennes wrote: Ping
Any ideas?
Post Reply