Conversation
| key = scope.pop | ||
| scope = scope.map { |s| "#{s}_scope".to_sym } | ||
| options.merge!(cascade: true) | ||
| options.merge!(cascade: options.fetch(:cascade, true)) |
There was a problem hiding this comment.
Waarom is de aanpassing hier ook nodig?
There was a problem hiding this comment.
Goed opgevallen. ExplicitScopeKey override de options die gezet worden in AlwaysCascade opnieuw. Dat zou de option cascade dus weer op false zetten.
Dit is waarschijnlijk zo gedaan, zodat beide workflows los aangeboden kunnen worden.
| context "does not cascade when cascade is set to false" do | ||
|
|
||
| it "returns an missing translation" do | ||
| expect(I18n.t("other", scope: "chamber_of_commerce", cascade: false)).to include("Translation missing") |
There was a problem hiding this comment.
Klopt het dat als de vertaling niet gevonden kan worden dan Translation missing gereturned moet worden? Of zou de key (in dit geval other) dan gereturned moeten worden?
There was a problem hiding this comment.
Omdat cascade op false heb staan wordt, zoals verwacht, de other key niet dieper in de hiërarchie opgezocht.
De chamber_of_commerce scope heeft geen other en daardoor wordt geen translation gevonden:
chamber_of_commerce_scope:
en: "Chamber of Commerce"
There was a problem hiding this comment.
Als ik bijvoorbeeld I18n.t("uihefeiuwh") (key bestaat niet) in de rails console uitvoer krijg ik "Uihefeiuwh " als output i.p.v. Translation missing. Klopt het dan dat je Translation missing krijgt? Of zou je dus de key (Uihefeiuwh) gereturned moeten krijgen?
This PR adds the option to disable the cascade functionality for the given translation