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

Add PG's own localization. #936

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Conversation

drgrice1
Copy link
Member

@drgrice1 drgrice1 commented Oct 5, 2023

This separates the webwork2 and PG localizations. PG now uses its own translation po and pot files and provides its own language handle for maketext. Only the language is passed in by the caller.

The translations in the PG code have been transferred from webwork2.

Note that this includes the fixes for using maketext inside the safe compartment that were in the now closed openwebwork/webwork2#2213.

That is the _compile method of Locale::Maketext is overridden to remove the use strict usage inside of its code eval call. That is the only essential difference between the override method added here and the original method in Locale::Maketext. With this you can use maketext interpolation in PG. For example, you can call maketext('[quant,_1,dog] ate my homework', $num_dogs).

@pstaabp
Copy link
Member

pstaabp commented Oct 9, 2023

I hadn't test the update-localization-files before, on this, but testing this now for #940, I'm getting the getopt error:

./bin/update-localization-files -p
getopt: illegal option -- o

I'm wondering if this is some strange MACOS error of getopt, even though it appears that is was supposed to be standardized, wikipedia says it can be system dependent. :(

@drgrice1
Copy link
Member Author

drgrice1 commented Oct 9, 2023

I assume that you also get that error on the webwork2 develop or main branch then. So the version of getopt on OSX is not fully compatible with the linux version it seems. I am not sure what to do about that. In any case, this is not really an issue introduced by this pull request it seems.

This separates the webwork2 and PG localizations.  PG now uses its own
translation po and pot files and provides its own language handle for
maketext.  Only the language is passed in by the caller.

The translations in the PG code have been transferred from webwork2.
@pstaabp
Copy link
Member

pstaabp commented Oct 13, 2023

I assume that you also get that error on the webwork2 develop or main branch then. So the version of getopt on OSX is not fully compatible with the linux version it seems. I am not sure what to do about that. In any case, this is not really an issue introduced by this pull request it seems.

Yes. Same issue there, so not introduced here. The script still works.

@pstaabp pstaabp merged commit eaef3d3 into openwebwork:develop Oct 23, 2023
2 checks passed
@drgrice1 drgrice1 deleted the pg-localize branch October 23, 2023 22:10
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