Skip to content

Conversation

@jeff-r
Copy link

@jeff-r jeff-r commented Jul 24, 2023

No description provided.

drgrice1 and others added 30 commits April 6, 2022 15:43
underscores.  They can already be entered with spaces.


Change the wording in the Filter, Edit, and Export selects as suggested in issue openwebwork#1480.
… sets.

This was a regression introduced in openwebwork#1585.  I missed a place where the
result of a list...Where method was used and needed to be mapped to the
actual field value.  I double checked, and this is the only place this
was forgotten.

Thanks @taniwallach for pointing this out.
…and-validation-fixes

More accessibility and html validation fixes as well as translation improvements.
…gression

Fix the filter on the ProblemSetList.pm for showing visible or hidden sets.
…ts page.

Generally clean Stats.pm up.  That file was a considerable mess.  Many
variables were defined and never used, and generally a lot of code was
unneeded.

Note that the borders on the svg image that are now appearing were in
the code before, but were not appearing because of an error in the style
attribute.  That was fixed, and the styles were also converted to proper
svg attributes.

For gateway quizzes, the links to problems now work.  Note that there is
no valid link to the actual problem in the gateway quiz.  So instead the
Problem.pm editMode is used.  This at least gives the instructor a link
that works and shows the problem which is really what is important here.
same as is shown on the stats page when clicking on a problem on that
page.  Note, that may not be the same as the problem number in the
actual gateway quiz if problem order is random for the quiz.
Furthermore, all will open in the same tab/window.
to the set, make it so that problems open in an undefined set.  This
fixes the remainder of issue openwebwork#1617.
sorting in the database.

This was not included in openwebwork#1585 because I didn't want to cause merge
conflicts with openwebwork#1569.

The file is also cleaned up a bit and the gateway versions listing and
homework problem listing sections separated in a more logical and
readable way.  Those sections were perltidied.
update-copyright script in the bin/dev_scripts directory.  This file
should be run immediately before each release to update the copyright in
all files.

Also move the update-localization-files into the bin/dev_scripts
location, and add a README.md to that location that states that the files
in that directory are for development use only, and not for those just
installing webwork.
… bash`.

Also check that a file is writable before trying to modify it.
With this change the script will only update the webwork2.pot file using
xgettext.pl by default.  It will not also update the .po files using
msgmerge.

However, there are now options for this script.  If you run the script
with no options it will do what is stated above.  If you add the option
`-p`, then it will also update all .po files.  If you instead use the
option `-l` with a language code, then it will update only that .po file
in addition to updating the webwork2.pot file.  For example if you run
`update-localization-files -l fr-CA`, then it will update the
webwork2.pot file, and then update the fr-CA.po file.

The point of this is that with the switch to using Transifex, we no
longer need to directly update po files.  We only need to update the
webwork2.pot file.  When those changes are merged into the develop
branch, then Transifex will automatically get those changes, and those
changes will be added to all of the languages there.  When Transifex
makes a pull request back to webwork2 for a language, those strings will
be included.

The optional flags are for translators.  If a translator wants to add
the current strings from the code to the po file so that they can start
working on translations before we merge the updated webwork2.pot file,
then they can use this script with the options to do so.

This also adds the conf directory to those xgettext.pl searches for
translation strings as is done in openwebwork#1631 to make sure that gets into this
file in its new location.
Remove some more redundant database calls in ProblemSet.pm and add sorting in the database.
Delete the fix_copyright.sh script, and instead create an update-copyright script in bin/dev_scripts.
Fix numerous display and html validation issues on the instructor stats page.
…source-slug

Update the resource slug for the webwork2.pot file in tx/config.
Instead of formatting the unix timestamp for display in the inputs for
dates in the instructor tools, just use the unix timestamp in those
inputs.  The flatpickr javascript now hides those inputs and adds an
input that the user actually sees.  That input contains a localized time
string that is formatted for the locale (language) of the course via
native javascript's Intl.DateTimeFormat.  The flatpickr javascript takes
care of updating the value of the hidden input with a unix timestamp as
the user changes the visible input.

To make this work well the dates that are only used for display are
formatted with a different approach by Perl.  The DateTime format_cldr
is used for this instead of strftime.  This allows for the use of the
DateTime::Locale methods which provides uniform formatting for different
languages.  A special case is added to the lib/WeBWorK/Utils.pm
formatDateTime function to handle this.

To be precise, javascript uses Intl.DateTimeFormat with the options
`{ dateStyle: 'short', timeStyle: 'short' }`, and perl uses the
formatting string returned by `$dt->locale->datetime_format_short`.

This also makes things work cleaner in the way that the server handles
dates because you don't need to worry about parsing a date string back
to a unix timestamp.

For most languages the perl DateTime::Locale formatting and javascript
Intl.DateTimeFormat formatting are the same.  Unfortunately, for a few
languages Perl's DateTime::Locale formatting is not correct.  This can
be seen when editing a problem set values for a user.  The user values
are formatted by javascript, and the class values by perl.  The
languages that seem to have problems here are any of the Asian
languages.  In Korean javascript gives `22. 3. 16. 오전 12:00` and perl
gives `23. 3. 16. AM 12:00`.  Clearly perl is not properly translating
the AM/PM part.  For zh_CN javascript gives `2022/3/16 00:00` and perl
gives `2022/3/16 上午12:00`.  Javscript gives a 24 hour time, and perl
uses a 12 hour time.  For zh_hk javascript gives `16/3/2022 上午12:00`
and perl gives `2022/3/16 上午12:00`.  So perl does not seem to use the
correct ordering of the year, month, and day for that locale.

Of course this means that the old strftime format `%m/%d/%Y at %I:%M%P`
is not used for set dates anymore.  For English the CLDR format returned
by `datetime_format_short` that is now used is `M/d/yy, h:mm a`.  This
means instead of `03/16/2022 at 12:00am` you get `3/16/22, 12:00 AM`.  I
would prefer `03/16/2022, 12:00 AM`, but that is what our locale gives
consistently for javascript and perl.  So it is probably best to go with
the standard.

Note that the old format is still used for set export and import files.
In fact that is the only place that the parseDateTime method is still
used.  It is used there to ensure that the correct timezone is set for
the saved dates.

Note that the `useDateTimePicker` option has been removed.  That could
be re-implemented if desired, but it would be a bit tedious to do so.
The problem is that the date/time picker does not format and parse
dates, but if that option is disabled then you would need to.  I don't
really see the need for that option anymore though.

There is a minor change in the lib/WeBWorK/Utils/LanguageAndDirection.pm
file.  That was using the po filenames directly for the html `lang`
attribute.  Those filenames use underscores which are not valid for
the `lang` attribute.  So the underscores are translated to dashes.
the browser's timezone and the course timezone.
instead of using javascript Intl formats for date/times, use format
strings chosen to match the perl DateTime::Locale formats.  We have to
use formats in any case to correctly parse strings back to a unix
timestamp.  So we might as well use them both ways, and make the perl
display match that of the javascript better.  There is only one
exception.  That is for the Korean language.  The perl DateTime::Locale
does not translate the AM/PM meridian, and the javascript does.  There
isn't much that can be done about that except for fixing the perl
DateTime::Locale data.
That is not needed anymore now that they have been renamed.

Add `dir="ltr"` to the dates in the ProblemSetList.pm main table.
Use time strings formatted for the locale for homework set dates.
This fixes several bugs.

One issue is one that I caused when I switched from using the
`onclick` attributes and inline javascript to using `addEventListener`
and external javascript.  I missed a case where the "More/Less like
this" handling changed the `onclick` attribute.  That has now been
converted to change the appropriate data attribute instead.

Another issue was that the "Target Set" select was directly using its
values for labels.  In particular it was using the "Select a Set from
this Course" value which is translated.  The javascript looks for that
value, and if it is translated it fails.  So now proper labels and
values are used.  Furthermore the labels for sets have the underscore
translated to spaces.  In addition, all of the "All ..." options for the
subjects, chapters, sections, etc., are now translated in labels.  Of
course the values are not translated.

In problemsetdetail.js there is a minor issue fixed in that the executor
of a promise should not be an async function.

Translations are also added for some of the dialogs on the library
browser page (the ones that will typically appear in day-to-day use).
These are passed to the javascript via data attributes.
homework set detail pages, and look that up when rendering problems so
that they are rendered in the course language.  This replaces openwebwork#1491, and
will work even for the misnamed Hebrew translation file.
  When viewing student progress on the student progress or
  stats page, provide a list of student links in the siblings
  links instead of sets assuming that when viewing student
  progress a user may want quicker access to other students.
transifex-integration bot and others added 30 commits July 15, 2022 15:08
translation completed for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'he_IL' language.
…07-15

Localization update of webwork2.pot - final for WeBWorK-2.17 release candidate
…update_2c8dfe77ba

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'he_IL'
…ose.yml

Move some docker files to be dist files (and out of main directory)
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'de' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'es' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'fr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'hu' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'ko' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'tr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'zh_CN' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'zh_HK' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'fr_CA' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'ru_RU' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
at least 1% translated for the source file '/lib/WeBWorK/Localize/webwork2.pot'
on the 'cs_CZ' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
…update_426aa555ba

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'de' [manual sync]
…update_57f4225881

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'es' [manual sync]
…update_69a309b01c

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'cs_CZ' [manual sync]
…update_18612f0efb

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'ru_RU' [manual sync]
…update_6cddca662b

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'fr_CA' [manual sync]
…update_19919ae7d9

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'zh_HK' [manual sync]
…update_b66286f39c

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'zh_CN' [manual sync]
…update_dddf8100db

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'tr' [manual sync]
…update_d23ae80e68

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'ko' [manual sync]
…update_e78b881df7

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'hu' [manual sync]
…update_9cdac29bdb

Translate '/lib/WeBWorK/Localize/webwork2.pot' in 'fr' [manual sync]
Merge develop into the release candidate to pull in translations and synchronize the branches
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.