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

157 missing translations warning #571

Merged
merged 23 commits into from
Feb 10, 2022

Commits on Nov 19, 2021

  1. add: warning for missing translations in the survey sheet

    - added tests have a couple of todo's to follow up
    - will also need to add:
      - test cases for happy path and other translatable columns
      - the same sort of check for the translatable choices sheet columns
    - also added some obvious type annotations and moved repeated usages of
      "default" for the default language to the constants module.
    lindsay-stevens committed Nov 19, 2021
    Configuration menu
    Copy the full SHA
    e572ea4 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2021

  1. add: happy path tests for establishing translations behaviour

    - in the tests in the prior commit it was becoming difficult to discern
      the correct / normal behaviour is for various translation scenarios
    - includes numerous todo's for suspect behaviour that may be bugs
    - added guidance_hint to translatable columns list
    lindsay-stevens committed Nov 22, 2021
    Configuration menu
    Copy the full SHA
    bd7cf43 View commit details
    Browse the repository at this point in the history
  2. fix: formatting

    lindsay-stevens committed Nov 22, 2021
    Configuration menu
    Copy the full SHA
    b796c37 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ecc63f6 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2021

  1. add: test cases / handling for issue 157 case and media cols, tidy up

    - simplified representation of issue 157 source case where label + hint
      are in French, with a default lang image column, and no default set.
    - media columns were not being detected correctly since the survey_sheet
      object nests audio, image and video in a "media" dict.
    - updated constants list with comment on other possible translatable
      columns in case pyxform supports them in future.
    - general tidy up of test xpaths and usages of them, such as to remove
      combination/shortcut xpaths, specify absence of ref or form attributes
      where relevant, condense guidance/audio/image/video xpaths.
    - remove duplicate test todo's for the same issue in a similar context.
    lindsay-stevens committed Nov 23, 2021
    Configuration menu
    Copy the full SHA
    8ae5482 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2021

  1. add: test cases for choices sheet translations, organise tests

    - moved TranslationTest.test_missing_media_itext to TestTranslations
    - moved new TranslationTest tests to TestTranslationsSurvey
    - added TestTranslationsChoices
      - similar to survey tests, added to clarify existing behaviour
      - includes some initial cases, for with/out a lang and choice_filter
      - some overlap with module test_secondary_instance_translations.py
        which should be resolved once these tests are complete.
    - added a XPathHelper class to try and make the choices tests more
      legible and easier to document, vs. the constants used for survey
      tests. Could adapt / extend helper for survey tests as well.
    lindsay-stevens committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    3c69a6f View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2021

  1. chg: refactor remaining translation tests to use XPathHelper, add docs

    - Update TestTranslations and TestTranslationsSurvey that were using
      string constants to use XPathHelper so that the assertions being made
      are easier to follow.
    - Add XPathHelper method docstrings to describe what they assert.
    lindsay-stevens committed Nov 26, 2021
    Configuration menu
    Copy the full SHA
    1763349 View commit details
    Browse the repository at this point in the history
  2. add: show the XPath and the XForm when an assert_xpath_count fails

    - Previously just showing the XForm made it a mystery which of the
      (potentially many) XPath expressions failed to match.
    lindsay-stevens committed Nov 26, 2021
    Configuration menu
    Copy the full SHA
    83ef307 View commit details
    Browse the repository at this point in the history
  3. add: tests / handling for constraintMsg and requiredMsg missing langs

    - Add to existing warning for missing translations where the affected
      columns are constraint_message or required_message
    - Due to a difference in the internally used name and supported external
      aliases, the TRANSLATABLE_SURVEY_COLUMNS object is now a dict and
      moved to aliases.py so it is closer to the existing aliases dicts to
      help keep them in sync.
    lindsay-stevens committed Nov 26, 2021
    Configuration menu
    Copy the full SHA
    37ba6ee View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2021

  1. fix: remove leftover debug=True parameter, correct docstring typo

    - debug=True causes the XForm and other test info to be printed out but
      this shouldn't be present on committed tests.
    - If warnings__* parameters are misspelled then they don't do anything.
    lindsay-stevens committed Nov 30, 2021
    Configuration menu
    Copy the full SHA
    dfeca3e View commit details
    Browse the repository at this point in the history
  2. add: check for missing translations in choices sheet

    - checks columns shown in aliases.py
    - check done alongside survey check so there's just warning message
      about missing translations
    - add choices warning test cases for same set of scenarios as for survey
    - update existing survey tests to use warnings__contains or not_contains
      instead of passing in list and doing assertIn / assertNotIn
    lindsay-stevens committed Nov 30, 2021
    Configuration menu
    Copy the full SHA
    90a2895 View commit details
    Browse the repository at this point in the history
  3. chg: move missing_translations_check into validator subpackage

    - the three related functions for this check are parts of a validation,
      and they otherwise clutter up xls2json.py a bit.
    - may make sense to move other xls2json checks into the same package
      so it's clearer what validations pyxform does.
    lindsay-stevens committed Nov 30, 2021
    Configuration menu
    Copy the full SHA
    d3e6f82 View commit details
    Browse the repository at this point in the history
  4. add: test case for xlsform with missing translations in survey + choices

    - combination of existing tests with same name pattern but in one test
      case that has both warning and no-warning assertions.
    lindsay-stevens committed Nov 30, 2021
    Configuration menu
    Copy the full SHA
    ffd073d View commit details
    Browse the repository at this point in the history
  5. fix: formatting

    lindsay-stevens committed Nov 30, 2021
    Configuration menu
    Copy the full SHA
    06fe4c0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6626782 View commit details
    Browse the repository at this point in the history
  7. fix: formatting

    lindsay-stevens committed Nov 30, 2021
    Configuration menu
    Copy the full SHA
    ad6830d View commit details
    Browse the repository at this point in the history
  8. fix: formatting

    lindsay-stevens committed Nov 30, 2021
    Configuration menu
    Copy the full SHA
    99b0eae View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2021

  1. add: performance test for missing translations check (default skipped)

    - to check whether the missing translation check incurs a reasonable
      time cost, considering that it traverses the full XLSForm dict
      available in xls2json rather than earlier in the pipeline to just
      check sheet headers. It seems there is very little difference for a
      giant form with 500 questions and 2 choices per question.
    lindsay-stevens committed Dec 6, 2021
    Configuration menu
    Copy the full SHA
    978c307 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into pyxform-157

    # Conflicts:
    #	pyxform/xls2json.py
    lindsay-stevens committed Dec 6, 2021
    Configuration menu
    Copy the full SHA
    f1babeb View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2022

  1. fix: performance improvements for large forms

    - missing translations check can still work while only looking at first
      row, which is a little faster and still passes the tests.
    - while profiling, found an inefficient unique check in section.py. The
      benefit is only apparent with forms >1000 questions, but it is
      significant: q=5000 28s vs. 11s, q=10000 103s vs. 21s.
    lindsay-stevens committed Jan 21, 2022
    Configuration menu
    Copy the full SHA
    eb6f0fe View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2022

  1. Configuration menu
    Copy the full SHA
    6e9adb6 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2022

  1. chg: remove default_language from check criteria, update warning format

    - default_language setting shouldn't influence the warning since the
      underlying issue is missing languages, and the setting just happens
      to be a way around one of the problems that causes.
    - updated the warning format to be one line per lang/sheet, with column
      names listed in the line.
    - includes corresponding test changes for the above, and re-configures
      how the check func processes data to better match the warning format.
    lindsay-stevens committed Feb 7, 2022
    Configuration menu
    Copy the full SHA
    ed1701c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8c12e4e View commit details
    Browse the repository at this point in the history