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

Fixed #15686: Corrected capitalization for dashboard section titles by removing strtolower() #15687

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

NebelKreis
Copy link

@NebelKreis NebelKreis commented Oct 17, 2024

Corrected capitalization for dashboard section titles (Assets, Licenses, Consumables, Components, Users) by removing strtolower()

Description

This PR addresses the incorrect title capitalization issue in the Snipe-IT dashboard. Previously, the strtolower() function was applied to section titles such as “Assets” and “Licenses”, which caused improper capitalization, especially in languages where nouns should be capitalized (e.g., German).

To resolve this, the following changes were made:

Removed the strtolower() function from the dashboard titles, allowing titles to maintain their correct, original capitalization.

  • As a result, the translations are no longer manipulated and are now directly sourced from the single source of truth translation file. This approach ensures that all translations are managed from a central location, which is the proper way to handle localization, reducing redundancy and preventing similar issues in the future.

Fixes Issue:
This change improves title presentation across different languages, enhancing user experience and maintaining linguistic accuracy.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

The changes have been tested as follows:

  • Manual Testing: Verified the correct capitalization of dashboard titles in multiple languages, including German and French. Ensured that titles no longer use lowercase formatting and respect language-specific capitalization rules.
  • Unit Tests: Updated and added unit tests to confirm that the removal of strtolower() does not introduce regressions or new issues. Ensured that all tests pass with the new changes.

Test Configuration:

  • PHP version: 8.1.2
  • MySQL version: 8.0.39
  • Webserver version: Apache 2.4.52
  • OS version: Ubuntu 24.04

Checklist:

This fix ensures the correct capitalization in different languages.
Copy link

what-the-diff bot commented Oct 17, 2024

PR Summary

  • Removal of strtolower function
    The team has removed the function that was converting text to lowercase in different parts of the code.

  • Direct use of translated strings
    They've improved the way items such as assets, licenses, accessories, consumables, components, and people are displayed. These now directly use their translated versions without converting them to lowercase. This enhancement ensures the correct display of text and respects language nuances in the used text descriptions.

@snipe
Copy link
Owner

snipe commented Oct 17, 2024

Again, I understand the need for this, just trying to figure out if there's a way to keep the lowercase aesthetic for languages where capitalization is less meaningful.

@NebelKreis
Copy link
Author

Again, I understand the need for this, just trying to figure out if there's a way to keep the lowercase aesthetic for languages where capitalization is less meaningful.

How would you feel if I implemented a controller that contains a list of the 8 languages which capitalize standalone nouns? The controller could then check the currently set language and decide whether to apply strtolower() or leave the nouns as they are. Would this be a good approach to solve the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants