Commit Graph

6 Commits

Author SHA1 Message Date
Jacob Burroughs 4b5cfc36e4 Don't try to extract translations from vendor
Change-Id: Iade5a790d6df9d762a37641d943db219e8b64dd7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286322
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-03-03 17:48:51 +00:00
Ahmad Amireh 5a9a4f3470 (re) decentralize i18nliner configuration
refs FOO-1408
flag = none

This reverts commit c904d83673.
Original commit 9af1badd2f.

I've also made an adjustment where you may only include a directory and
not a specific file so that we don't make it possible to configure
outside of an ".i18nrc" file (a measure to eliminate surprises that's
all)

before:

    { "include": [ "path/to/dir/.i18nrc" ] }

now:

    { "include": [ "path/to/dir" ] }

:: test plan

run "rake canvas:compile_assets" and visit any page with JavaScript
text, that text should display correctly

Change-Id: I320ec4056270647835035f45501d310b18d9cb25
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258178
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-03-10 18:52:49 +00:00
Jacob Burroughs c904d83673 Revert "decentralize i18nliner configuration"
This reverts commit 9af1badd2f.

Change-Id: I159a478d1f3baa062148e3fd5ff4ee914176579c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256982
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-01-19 19:52:58 +00:00
Ahmad Amireh 9af1badd2f decentralize i18nliner configuration
fixes FOO-1408

this allows us to control which files i18nliner processes completely
through config and without having to modify hardcoded paths in source
file, which is something we need for FOO-1265

.i18nrc files can include other directories through the "include"
directive:

    // file: canvas-lms/.i18nrc
    { "include": [ "public/javascripts/.i18nrc" ] }

    // file: public/javascripts/.i18nrc
    { "files": [...] }

:: test plan

aside of Jenkins exercising the i18n tasks, I ran a diff by hand over
the set of files that i18nliner processses before and after the patch,
with the new code processing a few more files: some handlebars in the
analytics plugin and the 3 client_apps/canvas_quizzes source files

if you really want to, you can do the same or find another way to verify
the output

on master, edit canvas_i18nliner/js/main.js somewhere before the
exports:

    Check.prototype.checkWrapper = f => console.warn(f)

run it:

    ./gems/canvas_i18nliner/bin/i18nliner check 2>
      tmp/i18nliner-upstream-files.txt

    cat tmp/i18nliner-upstream-files.txt | sort >
      tmp/i18nliner-upstream.txt

now do similar on our branch (although we need to massage teh output
because the paths are absolute:)

    ./gems/canvas_i18nliner/bin/i18nliner check 2>
      tmp/i18nliner-patched-files.txt

    cat tmp/i18nliner-patched-files.txt | sort >
      tmp/i18nliner-patched.txt

    sed -i "s{$PWD/{{" tmp/i18nliner-patched.txt

now look for differences:

    git diff --no-index \
      tmp/i18nliner-upstream.txt \
      tmp/i18nliner-patched.txt

Change-Id: Ic73cbc7261ab597deb567fc5d0af1e3014875da1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255952
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-01-07 15:58:18 +00:00
Cody Cutrer d34df4bc67 bump rails 3 to github branch for ruby 2.2 compatibility
see https://github.com/rails/rails/pull/18306 for discussion on
why it's not released yet

Change-Id: Id0de57432df9e7db1767c8f4d75c7734799148b9
Reviewed-on: https://gerrit.instructure.com/48828
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-02-18 22:55:20 +00:00
Jon Jensen 5a040333cd i18nliner(.rb)
this swaps out (most of) our ruby haax with i18nliner

test plan:
1. verify string extraction:
   1. `rake i18n:generate` before and after this commit
   2. confirm `config/locales/generated/en.yml` is identical
2. verify english defaults:
   1. use canvas in english
   2. confirm everything looks correct
3. verify translation keys/scopes:
   1. run canvas w/ RAILS_LOAD_ALL_LOCALES=true and optimized js
   2. use canvas in spanish
   3. confirm that todo está bien
4. confirm you can now use i18nliner-y features:
   1. call `t` without a key
   2. use the fancy erb block syntax

Change-Id: I979479c0889fe7e31ee0c962a4bd1998ab54d711
Reviewed-on: https://gerrit.instructure.com/42785
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-10-29 21:59:39 +00:00