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

Enable Various Translations Within /usage Page #697

Open
wants to merge 4 commits into
base: integration
Choose a base branch
from

Conversation

aaronskiba
Copy link
Collaborator

Fixes #696

Changes proposed in this PR:

  • Enable translations within usage statistic graphs. Specifically, dates and template names (see screenshot below):
    Screenshot from 2024-03-21 13-14-16
  • Enable translations within downloadable Usage Statistic CSV files.

NOTE:

  • The commit descriptions are quite detailed. Reading them should help with reviewing this PR.

app/controllers/usage_controller.rb
- Enable date translations when downloading "No. users joined during last year" as well as "No. plans during last year"

app/helpers/usage_helper.rb
- return translated date from prep_data_for_template_plans_chart() if there is no data
- return translated date from prep_date_for_charts()
  - prep_date_for_charts() is called twice in prep_data_for_template_plans_chart() (this could probably be optimised)

app/models/stat_created_plan.rb
- Enable date translations when downloading "No. plans by template"

app/services/org/monthly_usage_service.rb
- Enable date translations for "Download Monthly Usage" .csv file

config/locales/
- Added date.formats.month_year_abbr: "%b-%y" for each file

spec/ tests
- Update usage statistics tests w/ translated dates
app/helpers/usage_helper.rb
- This enables translations for the template names listed within the legends for "No. plans by template" and "No. plans created based off your templates"

app/views/translation_io_exports/_csv_headers.erb
- The segments added to this new file correspond to headers that are generated when downloading usage statistic .csv files. Prior to this commit, none of these segments existed within the translation.io project.

lib/csvable.rb
- This enables translations for the template names listed as headers when downloading the .csv for "Global usage" as well as "No. plans by template"

Add missing csv header segments

These segments correspond to generated .csv headers when downloading Usage Statistics. These segments also do not currently exist within translation.io
@aaronskiba aaronskiba linked an issue Mar 21, 2024 that may be closed by this pull request
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.

Enable Various Translations Within /usage Page
1 participant