-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i18n: Apply translation scheme. #100
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
{ | ||
"records": "records", | ||
"recordViewable": "viewable", | ||
"recordDownloadable": "downloadable", | ||
"readMore": "Read more", | ||
"search.loading": "Loading ...", | ||
"dropFile": "drop file", | ||
"Back": "Back", | ||
"search.field.any.placeholder": "Search datasets, services and maps ...", | ||
"search.field.sortBy": "Sort by", | ||
"relevancy": "Relevancy", | ||
"createDate": "New records", | ||
"dateStamp": "Last updates", | ||
"popularity": "Popularity", | ||
"results.records.hits.found": "{hits, plural, =0{No documents match the specified search.} one{} other{{hits} records found.}}", | ||
"results.records.hits.found=0.help": "Suggestions: <ul class='list-disc list-inside'><li>Try other words</li><li>Specify fewer words</li></ul>", | ||
"results.layout.selectOne": "Results layout", | ||
"facets.block.title.tag": "Keywords", | ||
"availableInDownloadService": "Download", | ||
"availableInViewService": "View", | ||
"facets.block.title.OrgForResource": "Organisation", | ||
"facets.block.title.availableInServices": "Available for", | ||
"facets.block.title.cl_hierarchyLevel.key": "Resource type", | ||
"facets.block.title.cl_status.key": "Status", | ||
"facets.block.title.cl_maintenanceAndUpdateFrequency.key": "Update frequency", | ||
"facets.block.title.cl_spatialRepresentationType.key": "Spatial representation", | ||
"facets.block.title.cl_status.key": "Status", | ||
"facets.block.title.creationYearForResource": "Creation year", | ||
"facets.block.title.th_regions_tree.default": "Regions", | ||
"facets.block.title.OrgForResource": "Organisation", | ||
"facets.block.title.resolutionScaleDenominator": "Scale", | ||
"facets.block.title.tag": "Keywords", | ||
"facets.block.title.tag.default": "Tag", | ||
"facets.block.title.availableInServices": "Available for" | ||
"facets.block.title.th_regions_tree.default": "Regions", | ||
"nav.back": "Back", | ||
"record.action.download": "downloadable", | ||
"record.action.view": "viewable", | ||
"record.more.details": "Read more", | ||
"records": "records", | ||
"results.layout.selectOne": "Results layout", | ||
"results.records.hits.found": "{hits, plural, =0{No documents match the specified search.} one{} other{{hits} records found.}}", | ||
"results.records.hits.found=0.help": "Suggestions: <ul class='list-disc list-inside'><li>Try other words</li><li>Specify fewer words</li></ul>", | ||
"results.sortBy.createDate": "New records", | ||
"results.sortBy.dateStamp": "Last updates", | ||
"results.sortBy.popularity": "Popularity", | ||
"results.sortBy.relevancy": "Relevancy", | ||
"search.field.any.placeholder": "Search datasets, services and maps ...", | ||
"search.field.sortBy": "Sort by", | ||
"search.loading": "Loading ..." | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,25 +5,22 @@ import { SearchState } from '../state/reducer' | |
import { getSearchSortBy } from '../state/selectors' | ||
import { marker } from '@biesbjerg/ngx-translate-extract-marker' | ||
|
||
marker('last changed') | ||
marker('popularity') | ||
|
||
@Component({ | ||
selector: 'search-sort-by', | ||
templateUrl: './sort-by.component.html', | ||
}) | ||
export class SortByComponent implements OnInit { | ||
choices = [ | ||
{ | ||
label: 'relevancy', | ||
label: 'results.sortBy.relevancy', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how those strings will be reconized to be extracte d? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this particular case, I don't think we can rely on the extractor script - at some point this will not be hardcoded and we may have a list or config for this ... but I can restore the marker and use the npm script if it makes more sense ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I think it's better to keep the translation keys being extracted. It's a good practice to let the script update the file.
What do you mean exactly ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also if we use {
"search.field.any.placeholder": "Search datasets, services and maps ...",
"results.layout.selectOne": "Results layout",
"search.field.sortBy": "Sort by",
"records": "records",
"record.action.view": "viewable",
"record.action.download": "downloadable",
"record.more.details": "Read more",
"results.records.hits.found=0.help": "Suggestions: <ul class='list-disc list-inside'><li>Try other words</li><li>Specify fewer words</li></ul>",
"results.records.hits.found": "{hits, plural, =0{No documents match the specified search.} one{} other{{hits} records found.}}",
"search.loading": "Loading ...",
"results.sortBy.relevancy": "Relevancy",
"results.sortBy.dateStamp": "Last updates",
"results.sortBy.popularity": "Popularity",
"dropFile": ""
} which looks to be incomplete. Should we then add markers for all facets stuffs ? Web component translation like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it work well for the datafeeder app ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Not sure they are using, nobody read the manual ! :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
IMO yes
Maybe it's just the path config in the package.json script It helps to see some translations are missing, or some key are not well formatted, I keep thinking it's a good practice but I won't force it you find it painfull to maintain. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's see if it works. Markers added. Format consistent with prettier. Web component path fixed. |
||
value: '_score', | ||
}, | ||
{ | ||
label: 'last changed', | ||
label: 'results.sortBy.dateStamp', | ||
value: '-dateStamp', | ||
}, | ||
{ | ||
label: 'popularity', | ||
label: 'results.sortBy.popularity', | ||
value: 'popularity', | ||
}, | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did you change the order ? Did you use the npm script to extract the translations ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON sort plugin.
We discussed to apply a common pattern/scheme to translation keys - like in
https://github.com/geonetwork/geonetwork-ui/blob/master/apps/datafeeder/src/assets/i18n/en.json or https://github.com/geonetwork/geonetwork-microservices/blob/main/modules/services/ogc-api-records/service/src/main/resources/messages/api.properties
no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I was confused by the term "schema"