Closed Smullz622 closed 6 months ago
Yeah, I see what you mean wrt capitalization being an issue with interpolation. I played around with it a bit, since I generally like interpolation, but didn't come up with a solution I liked...there's not a way, as far I could tell, to just have the string in the yaml file automatically be sentence case. Plus there's plural vs. singular potentially screwing things up as well. I think your solution makes sense.
I think you can use
#capitalize
to properly capitalize a sentence. So maybe we could do interpolation here, but use#capitalize
on the whole string returned byI18n
?I'm just not too sure how I feel about this logic:
&& !thesis_title.match?(/Translation missing/)
.
There is also the complication of irregular pluralization going on: 'Thesis' turning into 'theses', which would add another step to interpolation. But I do agree that matching on the 'Translation missing' string feels brittle – it would break if I18n changed the error message wording.
There is also the complication of irregular pluralization going on: 'Thesis' turning into 'theses', which would add another step to interpolation. But I do agree that matching on the 'Translation missing' string feels brittle – it would break if I18n changed the error message wording.
Oh right. What if we change Thesis drafts to be reviewed
to Draft theses to be reviewed
. Then they'd all be plural.
That would work; I'll change that wording & then try interpolation with #capitalize
Fixes #764 - adds logic to use the correct language with the correct graduate degree type
title_for
anddescription_for
are used for all filters in each instance, but we only want to change it for the grad school instance for dissertation degree types on the filters that have the word thesis/dissertation. The logic feels a little clunky, but the only alternative I could think if was to addthesis_description
to the translation for all of the filters which would be redundant/unnecessary for a lot of them. I considered using interpolation, but since capitalization varies by filter (Dissertation vs dissertation), it felt like the logic to handle that wouldn't be an improvement.