Skip to content
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

Rename submission file locale attribute to submissionLocale #9465

Closed
bozana opened this issue Oct 27, 2023 · 3 comments · Fixed by #10746 or pkp/ojs#4569
Closed

Rename submission file locale attribute to submissionLocale #9465

bozana opened this issue Oct 27, 2023 · 3 comments · Fixed by #10746 or pkp/ojs#4569
Assignees
Labels
Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days.
Milestone

Comments

@bozana
Copy link
Collaborator

bozana commented Oct 27, 2023

The SubmissionFile object has 'locale' attribute/data. This is the submission's (primary) locale. It seems to be used correctly everywhere, but it would be better to call it 'submissionLocale'? -- One could think it is the locale/language of the file, which is not true -- the locale of the file is the galley locale -- i.e. it can be a different language than submission primary locale.

@bozana bozana added this to the 3.5 Internal milestone Oct 27, 2023
@asmecher
Copy link
Member

@bozana, is it just a duplicate of the submission locale? If it doesn't have its own purpose, maybe it would be best to remove it.

@jonasraoni jonasraoni added the Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days. label Jan 31, 2024
asmecher added a commit to asmecher/pkp-lib that referenced this issue Dec 19, 2024
asmecher added a commit to asmecher/ojs that referenced this issue Dec 19, 2024
@asmecher
Copy link
Member

Just looking into this a little further -- the SubmissionFile::getLocale/setLocale are not persisted to the database. See github:

This is not properly a property of the submission file
(e.g. it won't be persisted to the DB with the update function)
It helps solve submission locale requirement for file's multilingual metadata

These attributes are in service of what has recently become the LocalizedData trait, which expects implementers to know what the getDefaultLocale is for the entity. In the case of Authors and SubmissionFiles, it should come from the submission; it's provided by the DAO (see the fromRow function in each case).

I've removed the getSubmissionLocale / setSubmissionLocale functions, which in the case of SubmissionFile were marked deprecated anyway. I've standardized on submissionLocale rather than locale in calls to setData / getData on the DataObject in order to make clear that these objects don't have their own independent locale column/attribute.

@asmecher asmecher self-assigned this Dec 19, 2024
asmecher added a commit to pkp/ojs that referenced this issue Dec 19, 2024
@asmecher
Copy link
Member

Merged; tests appear to be independently broken on another issue but the necessary parts completed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days.
Projects
None yet
3 participants