Added support for passing options to nested resources #81

Merged
merged 2 commits into from Apr 18, 2013

Projects

None yet

2 participants

@jessehouchins

I can't get the test suite running locally for some reason... possibly incompatible version of grunt. So I haven't written test yet. The changes in this PR allow me to do this:

"STATNAME"            : "$t(_STATS.__sport_id__.__key__, { defaultValue: '$t(_STATS.DEFAULTS.__key__)' })",
"STATABBR"            : "$t(_STATS.__sport_id__.___key__, { defaultValue: '$t(_STATS.DEFAULTS.___key__)' })",

"_STATS" : {
  "DEFAULTS" : {
    "behind"  : "Games Behind",
    "_behind" : "GB",
    "diff"    : "Win Differential",
    "_diff"   : "DIFF",
    "games"   : "Games played",
    "_games"  : "GP",
    "l"       : "Losses",
    "_l"      : "L",
    "otl"       : "Overtime Losses",
    "_otl"      : "OTL",
    "pa"      : "Points Allowed",
    "_pa"     : "PA",
    "pct"     : "Winning Percentage",
    "_pct"    : "PCT",
    "pd"      : "Point Differential",
    "_pd"     : "PD",
    "pf"      : "Points For",
    "_pf"     : "PF",
    "t"       : "Ties",
    "_t"      : "T",
    "tb"      : "Tiebreaker",
    "_tb"     : "TB",
    "w"       : "Wins",
    "_w"      : "W"
  },

  "1" : {
    "extra"     : "Extra Standings Points",
    "_extra"    : "EXTRA",
    "fpp"       : "Fair Play Points",
    "_fpp"      : "FPP",
    "ga"        : "Goals Against",
    "_ga"       : "GA",
    "gd"        : "Goal Differential",
    "_gd"       : "GD",
    "gf"        : "Goals For",
    "_gf"       : "GF"
  },
  "3" : {
    "ga"        : "Goals Against",
    "_ga"       : "GA",
    "gd"        : "Goal Differential",
    "_gd"       : "GD",
    "gf"        : "Goals For",
    "_gf"       : "GF"
  },
  "4" : {
    "ra"      : "Runs Allowed",
    "_ra"     : "RA",
    "rd"      : "Run Differential",
    "_rd"     : "RD",
    "rf"      : "Runs For",
    "_rf"     : "RF"
  }
}
@jamuhl
i18next member

okey...glad you removed the eval ;)

basically you changed the direction of resolving the nested resource. shouldn't do much harm but have to test later.

thanks for adding this. will get back to this as soon i got more time - but chances are high this gets merged for next release.

@jessehouchins

Sweet.

@jamuhl jamuhl merged commit 9e3435e into i18next:master Apr 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment