These are chat archives for fgpv-vpgf/gulp-i18n-csv

14th
Aug 2015
Aly Merchant
@alyec
Aug 14 2015 16:44
Does angular-translate require a nested json file?
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 16:44
No, but it can handle it.
Do you think I'm complicating things?
Aly Merchant
@alyec
Aug 14 2015 16:45
Possibly, I'm wondering why we need a nested json file ( #6 ) if we are actually doing in the work in a flat csv file.
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 16:46
RAMP's locale files are heavily nested in places.
Aly Merchant
@alyec
Aug 14 2015 16:47
Yes, but it was helpful because people could work on part of the hierarchy.
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 16:47
For grouping related strings.
Aly Merchant
@alyec
Aug 14 2015 16:48

For the CSV case can we have stuff like:

test.string,en_str,fr_str

map to

{"test.string":"en_str"}
{"test.string":"fr_str"}
I guess to clarify: do we lose the ability to use dots in the keys if we don't use nested json?
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 16:53
I guess so. You pass keys as strings to the translate filter or directive and it understands dots as nesting.
{{ 'page.title' | translate }}
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 17:01
Just tried it out: it works with dots in the keys as well.
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 17:07
Aly Merchant
@alyec
Aug 14 2015 17:12
I understood the links example, but not the shortcuts one.
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 17:19

They need to update their example. I understand it like this:

{
  "bar": {
    "foo": {
      "foo": "This is my text.",
      "dog": "guts"
    }
  }
}

Then use can reference strings like this:
bar.foo -> "This is my text."
bar.foo.foo -> "This is my text."
bar.foo.dog -> "guts"

Aly Merchant
@alyec
Aug 14 2015 17:21
That doesn't sound particularly useful. I'd rather we avoided using shortcuts in the new viewer.
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 17:25

Say you have
| key | string |
|--------------|------------------------|
| tab | Tab |
| tab.list | Tab List |
| tab.play | Tab Play |

Converting this to JSON you lose the first line:

{
    "tab": {
        "list": "Tab List",
        "play": "Tab Play"
    }
}

To avoid that, we can put the "tab" string inside the group under the "tab" substring:

{
    "tab": {
        "tab": "Tab",
        "list": "Tab List",
        "play": "Tab Play"
    }
}

This way everything works:
tab - > "Tab"
tab.list -> "Tab List"
tab.play -> "Tab Play"

What? No markdown tables?
Aly Merchant
@alyec
Aug 14 2015 17:27
I'd rather throw an error on the CSV parse, but that might just be my preference.
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 17:31
Yeap, I agree with that. But do you still think we don't need nesting? If we are not going to use links then we won't get any benefits from nesting strings (except maybe for a slightly smaller file sizes).
The about example breaks down if you have "tab.tab" string:
| key | string |
|--------------|------------------------|
| tab | Tab |
| tab.tab | Tab Tab |
| tab.list | Tab List |
| tab.play | Tab Play |
Aly Merchant
@alyec
Aug 14 2015 17:35
Kind of ambivalent about nesting. If you're using something like ok_text all over the place I'd rather just make a ui.general namespace and dump it in there instead of creating a whole lot of links. That said I don't find links as objectionable as shortcuts.
I just saw nesting as something we might be able to get away without implementing, but it's a small enough detail that I don't think will matter too much one way or the other.
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 17:38
:heavy_check_mark:
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 18:16
:)
Aly Merchant
@alyec
Aug 14 2015 18:17
And still no activity listed.
Aleksuei Riabtsev
@AleksueiR
Aug 14 2015 18:21

There is an option to do it manually:

Go to your repo on GitHub
Click on Settings
Click on Service Hooks
Select us
Use this token:
0c1da0e523763b82e906

Dan Bowerman
@dan-bowerman
Aug 14 2015 19:28
It worked
Aly Merchant
@alyec
Aug 14 2015 19:32
:clap:
Cynthia (Qingwei) Li
@cynngah
Aug 14 2015 20:00
wait does that mean #3 is fixed now?
Aly Merchant
@alyec
Aug 14 2015 20:01
Yes, Dan fixed it
Cynthia (Qingwei) Li
@cynngah
Aug 14 2015 20:01
:+1:
Aly Merchant
@alyec
Aug 14 2015 20:01
Previously there was no activity stream in the right panel on gitter.