Quantcast

Fwd: Re: Weblate git pre-commit hook

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Re: Weblate git pre-commit hook

Dimitry Polivaev
Administrator
He did it ;)

Could somebody review it?

Best,
Dimitry


-------- Forwarded Message --------
Subject: Re: Weblate git pre-commit hook
Date: Thu, 9 Apr 2015 11:58:44 +0200
From: Michal Čihař
To: Dimitry Polivaev

Hi

Dne Tue, 31 Mar 2015 15:48:09 +0200
Dimitry Polivaev

> Everything is a part of freeplane code base. We just need to run "gradle format_translation" from
> the freeplane source root directory. This task is defined in the gradle scripts belonging to the
> project, and its implementation uses an ant task which is implemented in subproject freeplane_ant
> and it is compiled by gradle on demand.
>
> What more do you need?

In the end I've decided it's easier for me to reimplement your script
in Python than installing all the Java stuff it would need to execute.
The script is now shipped with Weblate:

https://github.com/nijel/weblate/blob/master/examples/hook-sort-properties

I've enabled it for your project, here is first commit formatted by it:

https://github.com/freeplane/freeplane/commit/452d5bda61d83e194d25b0b85c4526be4d4af9b8

--
        Michal Čihař | http://cihar.com | http://blog.cihar.com



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Re: Weblate git pre-commit hook

Volker Börchers
Administrator
Hi,

Michal's script is a bit more picky than the format_translation task
since it is more strict about the case of unicode codes but this is
perfectly acceptable for us. I have appended the diff after applying the
script to all our resource files: Only two files are modified and only
in a good way (see appended diff).

Well done and thanks to Michal!

Regards,
Volker

Am 10.04.2015 um 21:43 schrieb Dimitry Polivaev [via Freeplane Developer]:

> He did it ;)
>
> Could somebody review it?
>
> Best,
> Dimitry
>
>
> -------- Forwarded Message --------
> Subject: Re: Weblate git pre-commit hook
> Date: Thu, 9 Apr 2015 11:58:44 +0200
> From: Michal Čihař
> To: Dimitry Polivaev
>
> Hi
>
> Dne Tue, 31 Mar 2015 15:48:09 +0200
> Dimitry Polivaev
>
>  > Everything is a part of freeplane code base. We just need to run
> "gradle format_translation" from
>  > the freeplane source root directory. This task is defined in the
> gradle scripts belonging to the
>  > project, and its implementation uses an ant task which is implemented
> in subproject freeplane_ant
>  > and it is compiled by gradle on demand.
>  >
>  > What more do you need?
>
> In the end I've decided it's easier for me to reimplement your script
> in Python than installing all the Java stuff it would need to execute.
> The script is now shipped with Weblate:
>
> https://github.com/nijel/weblate/blob/master/examples/hook-sort-properties
>
> I've enabled it for your project, here is first commit formatted by it:
>
> https://github.com/freeplane/freeplane/commit/452d5bda61d83e194d25b0b85c4526be4d4af9b8
>
> --
>          Michal Čihař | http://cihar.com | http://blog.cihar.com
>
>
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://freeplane-developer.996965.n3.nabble.com/Fwd-Re-Weblate-git-pre-commit-hook-tp669.html
>
> To start a new topic under Freeplane Developer, email
> [hidden email]
> To unsubscribe from Freeplane Developer, click here
> <
> NAML
> <
http://freeplane-developer.996965.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

format_translation.diff (145K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Re: Weblate git pre-commit hook

Felix Natter
Administrator
"Volker Börchers [via Freeplane Developer]"
<[hidden email]> writes:

> Hi,

hello,

please direct a big praise to Michal, very very well done!

> Michal's script is a bit more picky than the format_translation task
> since it is more strict about the case of unicode codes but this is
> perfectly acceptable for us. I have appended the diff after applying
> the

I think we should disable the automatic execution of check_translation
in gradle because the python script may not (and need not) do 100% the
same. format_translation may still be useful if you add translation
properties so that you don't have to sort manually.

> script to all our resource files: Only two files are modified and only
> in a good way (see appended diff).
>
> Well done and thanks to Michal!

+1! (Maybe you should suggest that he offers this to other projects as
well, it might be useful for others too)

Best Regards,
Felix

> Regards,
> Volker
>
> Am 10.04.2015 um 21:43 schrieb Dimitry Polivaev [via Freeplane Developer]:
>
>> He did it ;)
>>
>> Could somebody review it?
>>
>> Best,
>> Dimitry
>>
>>
>> -------- Forwarded Message --------
>> Subject: Re: Weblate git pre-commit hook
>> Date: Thu, 9 Apr 2015 11:58:44 +0200
>> From: Michal Čihař
>> To: Dimitry Polivaev
>>
>> Hi
>>
>> Dne Tue, 31 Mar 2015 15:48:09 +0200
>> Dimitry Polivaev
>>
>> > Everything is a part of freeplane code base. We just need to run
>> "gradle format_translation" from
>> > the freeplane source root directory. This task is defined in the
>> gradle scripts belonging to the
>> > project, and its implementation uses an ant task which is implemented
>> in subproject freeplane_ant
>> > and it is compiled by gradle on demand.
>> >
>> > What more do you need?
>>
>> In the end I've decided it's easier for me to reimplement your script
>> in Python than installing all the Java stuff it would need to execute.
>> The script is now shipped with Weblate:
>>
>>
> https://github.com/nijel/weblate/blob/master/examples/hook-sort-properties
>>
>> I've enabled it for your project, here is first commit formatted by it:
>>
>>
> https://github.com/freeplane/freeplane/commit/452d5bda61d83e194d25b0b85c4526be4d4af9b8
>>
>> --
>> Michal Čihař | http://cihar.com | http://blog.cihar.com
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
> http://freeplane-developer.996965.n3.nabble.com/Fwd-Re-Weblate-git-pre-commit-
> hook-tp669.html
>>
>> To start a new topic under Freeplane Developer, email
>> [hidden email]
>> To unsubscribe from Freeplane Developer, click here
>> <
>> NAML
>>
> <http://freeplane-developer.996965.n3.nabble.com/template/NamlServlet.jtp?macro=macro_
> viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-
> nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-
> nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-
> nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_
> subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
> instant_email%21nabble%3Aemail.naml>
>>
>
> *
> format_translation.diff (145K) Download Attachment
>
> ---------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://freeplane-developer.996965.n3.nabble.com/Fwd-Re-Weblate-git-pre-commit-
> hook-tp669p670.html
> To start a new topic under Freeplane Developer, email
> [hidden email]
> To unsubscribe from Freeplane Developer, click here.
> NAML
>

--
Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Re: Weblate git pre-commit hook

Volker Börchers
Administrator
Hi,

>  > Michal's script is a bit more picky than the format_translation task
>  > since it is more strict about the case of unicode codes but this is
>  > perfectly acceptable for us. I have appended the diff after applying
>  > the
>
> I think we should disable the automatic execution of check_translation
> in gradle because the python script may not (and need not) do 100% the
> same. format_translation may still be useful if you add translation
> properties so that you don't have to sort manually.

No, the new weblate formatter and check_translation play well together
for the following reasons:

- We still have translations that are not entered via weblate.

- Weblate formatted translations pass check_translation

- check_translation has more checks about stuff that cannot be
automatically fixed. Currently we have a warning in the build:
[ant:check_translation] Resources_nb.properties: errorneous placeholders
usage: {1} used without {0}

Regards,
Volker
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Re: Weblate git pre-commit hook

Felix Natter
Administrator
"Volker Börchers [via Freeplane Developer]"
<[hidden email]> writes:

> Hi,

hello Volker,

>> > Michal's script is a bit more picky than the format_translation task
>> > since it is more strict about the case of unicode codes but this is
>> > perfectly acceptable for us. I have appended the diff after applying
>> > the
>>
>> I think we should disable the automatic execution of check_translation
>> in gradle because the python script may not (and need not) do 100% the
>> same. format_translation may still be useful if you add translation
>> properties so that you don't have to sort manually.
>
> No, the new weblate formatter and check_translation play well together
> for the following reasons:
>
> - We still have translations that are not entered via weblate.

JOrtho translations are not changed. Or are you saying that translators
actually check out our repo or send us the complete properties file?

> - Weblate formatted translations pass check_translation

I'm not sure that this is 100% the case. But I agree that we can fix
Michal's script in case such an issue pops up.

> - check_translation has more checks about stuff that cannot be
> automatically fixed. Currently we have a warning in the build:
> [ant:check_translation] Resources_nb.properties: errorneous placeholders
> usage: {1} used without {0}

Yes, that makes sense.

--> keeping check_translation in the build is OK for me.

Best Regards,
--
Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Re: Weblate git pre-commit hook

Volker Börchers
Administrator
Hi Felix,

>  > No, the new weblate formatter and check_translation play well together
>  > for the following reasons:
>  >
>  > - We still have translations that are not entered via weblate.
>
> JOrtho translations are not changed. Or are you saying that translators
> actually check out our repo or send us the complete properties file?

A more likely case are the initial translations that developers create
for their new keys.

Regards,
Volker
Loading...