Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate/french #1113

Merged
merged 4 commits into from
Feb 21, 2024
Merged

Translate/french #1113

merged 4 commits into from
Feb 21, 2024

Conversation

cregouby
Copy link
Collaborator

@cregouby cregouby commented Oct 8, 2023

A frugal proposal for enabling translations of the package, with release of the French translation

  • fix few typos in the messages
  • add FR translation
  • add translation § to CONTRIBUTIONS

FYI, the message extraction relies now on custom translation functions passed to {potools} to form the po/R-torch.pot file:

potools::po_extract(torch_dir, custom_translation_functions = list(R=c(
  "value_error:...\\env", 
  "type_error:...\\env", 
  "runtime_error:...\\env", 
  "not_implemented_error:...\\env",
  "warn:...\\env",
  "stop_iteration_error:...\\env", 
  "deprecated:...\\env") ))

@dfalbel
Copy link
Member

dfalbel commented Oct 10, 2023

Hi @cregouby ! Looks great! Thank you very much!
I'm trying to test it locally, but wasn't able to get the translated messages, is there somehting special I should do to enable them?

I basically installed torch from this PR and now trying to run the below, but still getting the error message ein english.

> library(torch)
> withr::with_language("fr", {nn_conv1d(3, 3, 2, 1, padding_mode = "bad_padding")})
Error in `value_error()`:
! padding_mode must be one of [zeros, reflect, replicate, circular],but got padding_mode='bad_padding'.

@cregouby
Copy link
Collaborator Author

Oups, sorry for that. I'm still stuck in the local compilation so I'm not really able to test it locally. I'll check it differently...

@dfalbel
Copy link
Member

dfalbel commented Oct 10, 2023

No worries! Do you want to schedule some time to talk about #1107 ? I can't also reproduce locally, but feels like some old libtorch is being picked up by when compiling lantern.

@cregouby
Copy link
Collaborator Author

Hello,
Thanks for the proposal, #1107 is fine now. (just using the procedure in CONTRIBUTION.md). And I do encounter the same bypass of the translation file. I'll dig in it.

@dfalbel dfalbel merged commit cba4453 into mlverse:main Feb 21, 2024
@cregouby cregouby deleted the translate/french branch February 28, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants