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

CLI: Language.json should only contain isoCode #27448

Closed
4 tasks
nollymar opened this issue Jan 26, 2024 · 3 comments · Fixed by #28197
Closed
4 tasks

CLI: Language.json should only contain isoCode #27448

nollymar opened this issue Jan 26, 2024 · 3 comments · Fixed by #28197

Comments

@nollymar
Copy link
Contributor

nollymar commented Jan 26, 2024

Parent Issue

No response

User Story

As a user, I want to be able to pull a language using a json file that only contains the isoCode and language name. For example:

{
  "dotCMSObjectType" : "Language",
  "isoCode" : "es"
}

The other fields should be excluded from the JSON file (it applies for push operations as well). Only language (name) and iso code should be considered.

{
"dotCMSObjectType" : "Language",
"id" : 4963328,
"languageCode" : "es",
"countryCode" : "",
"language" : "Spanish",
"country" : "",
"defaultLanguage" : false,
"isoCode" : "es"
}

Please modify the documentation and adjust the commands parameters accordingly

Acceptance Criteria

  • Language.json contains only these fields: isoCode and dotCMSObjectType (internal use only).
  • The only input required by a language command is the isoCode (when the json file is not provided).
  • The documentation must be updated accordingly
  • Update ITs

Proposed Objective

Core Features

Proposed Priority

Priority 3 - Average

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@nollymar nollymar moved this from New to Next 1-3 Sprints in dotCMS - Product Planning Jan 26, 2024
@nollymar nollymar moved this from Next 1-3 Sprints to Current Sprint Backlog in dotCMS - Product Planning Mar 6, 2024
@jgambarios jgambarios self-assigned this Mar 25, 2024
@jgambarios jgambarios moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planning Mar 25, 2024
@nollymar nollymar removed the Triage label Mar 28, 2024
jgambarios added a commit that referenced this issue Apr 9, 2024
…the language name and the ISO code.

This update modifies the `ContentComparator` interface to include a `localFile` parameter in its findMatchingServerContent and localContains methods. Also, modifications have been made to all applicable classes that implement this interface, including support for file renaming if content changes. A NameUtil class has been added to generate standardized file names for Site, Language, and ContentType. Other enhancements include updating the push and pull handlers for Site, Language, and ContentType and improving their respective functionalities.
jgambarios added a commit that referenced this issue Apr 9, 2024
jgambarios added a commit that referenced this issue Apr 10, 2024
jgambarios added a commit that referenced this issue Apr 10, 2024
jgambarios added a commit that referenced this issue Apr 10, 2024
jgambarios added a commit that referenced this issue Apr 10, 2024
jgambarios added a commit that referenced this issue Apr 10, 2024
jgambarios added a commit that referenced this issue Apr 11, 2024
@jgambarios jgambarios changed the title CLI: Language.json should only contain isoCode and languageName CLI: Language.json should only contain isoCode Apr 11, 2024
jgambarios added a commit that referenced this issue Apr 11, 2024
@jgambarios jgambarios moved this from In Progress to In Review in dotCMS - Product Planning Apr 12, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 15, 2024
* #27448 Updating code to support in the language file descriptor only the language name and the ISO code.

This update modifies the `ContentComparator` interface to include a `localFile` parameter in its findMatchingServerContent and localContains methods. Also, modifications have been made to all applicable classes that implement this interface, including support for file renaming if content changes. A NameUtil class has been added to generate standardized file names for Site, Language, and ContentType. Other enhancements include updating the push and pull handlers for Site, Language, and ContentType and improving their respective functionalities.

* #27448 Improve cache clearing

* #27448 Improvements in cache clearing

* #27448 Rolling back unneeded change

* #27448 Rolling back unneeded change

* #27448 Removing the language label as can also be calculated from the ISO code

* #27448 Renaming method

* #27448 Fixed NPE

* #27448 Handling ISO code as only available information in multiple commands

* #27448 Javadoc

* #27448 Updating IT

* #27448 Renaming class

---------

Co-authored-by: Nollymar Longa <[email protected]>
@github-project-automation github-project-automation bot moved this from In Review to Internal QA in dotCMS - Product Planning Apr 15, 2024
@nollymar nollymar reopened this Apr 15, 2024
@github-project-automation github-project-automation bot moved this from Internal QA to Current Sprint Backlog in dotCMS - Product Planning Apr 15, 2024
@nollymar nollymar moved this to Internal QA in dotCMS - Product Planning Apr 15, 2024
@nollymar nollymar self-assigned this Apr 17, 2024
@nollymar
Copy link
Contributor Author

Internal QA: Passed

Now, it is pretty easy to manipulate languages using only the iso code.

@nollymar nollymar removed their assignment Apr 18, 2024
@nollymar nollymar moved this from Internal QA to QA - Backlog in dotCMS - Product Planning Apr 18, 2024
@bryanboza
Copy link
Contributor

Fixed, now the iso code is only the required parameter in the language.json file, we take this and generate all the other parameters based on that one.

{
  "isoCode" : "es"
}

It will generate:

{
  "dotCMSObjectType" : "Language",
  "id" : 4963328,
  "languageCode" : "es",
  "countryCode" : "",
  "language" : "Spanish",
  "country" : "",
  "defaultLanguage" : false,
  "isoCode" : "es"
}

Tested on master // Docker // FF

@bryanboza bryanboza moved this from QA - Backlog to Done in dotCMS - Product Planning Apr 19, 2024
@jdcmsd
Copy link
Contributor

jdcmsd commented Apr 24, 2024

On a pull, how is the id property determined on the basis of the isoCode alone? Is it just assigned specifically for the case of a new language being added?

The reason I'm wondering: If languages are being pushed between sites during a migration, is it possible they could end up being assigned different id values, and might that have the potential to break code referencing language by id?

@nollymar nollymar added LTS: Needs Backport Ticket that will be added to LTS and removed LTS: Needs Backport Ticket that will be added to LTS labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants