snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.2k stars 3.2k forks source link

[7.0.11] Looks like hardcoded text in Category view #15330

Closed swift2512 closed 3 months ago

swift2512 commented 3 months ago

Debug mode

Describe the bug

Can't figure out from where it comes, but it's in Page Title and three different tested languages.

Reproduction steps

  1. Change to other language than English
  2. Open any Asset category

Expected behavior

Text is not in English.

Screenshots

image image

Snipe-IT Version

7.0.11

Operating System

Ubuntu

Web Server

apache

PHP Version

8.3

Operating System

Win10

Browser

Edge, Firefox

Version

latest

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

swift2512 commented 3 months ago

Same for accessories, licences, consumables and components. image

snipe commented 3 months ago

I can't tell what page you're looking at to see this. Can you give me the url fragment(s)?

swift2512 commented 3 months ago

Sorry, forgot to add URL. It's when you open any category of assets/accessories/etc.

http://192.168.11.215:1111/categories/1

Items count per page is missing for Lithuanian because of bootstrap-table. There's no localized version.

snipe commented 3 months ago

Thanks for the clarification. It is actually a translated string, but it's possible it hasn't been translated by the language volunteers yet:

https://github.com/snipe/snipe-it/blob/e8a22f3c5bf0fc22602a1373cf91090d40e9d734/resources/views/categories/view.blade.php#L6

Yeah, just confirmed with CrowdIn. No translation has been provided yet.

Screenshot 2024-08-19 at 3 06 50 PM
swift2512 commented 3 months ago

Will check tomorrow, but it doesn't look like it. Words are in different order. It's category name followed by word Assets (or Accessories, Consumables, etc.) and not like in resources/lang/en-US/general.php file. 562 'assets_in_var' => 'Assets in :name :type' Also, this would be valid only for assets, but as I mentioned earlier, it's same with other groups of items which can be split in categories (accessories, consumables, etc.)

snipe commented 3 months ago

Hard to tell - the English string I’m looking at may also be more up to date than what you’re looking at - are you on latest on master?

swift2512 commented 3 months ago

Looks like it was older master. Pulled new version (version and buil No. stayed the same) this morning and text in Assets is correct. Yet, different strings should be used for other item groups, because now it's Assets for components, licenses, consumables. Or if it's one string, word 'Assets' should be replaced by 'Items' and then it all would make sense. Also, some names still in English and I doubt these haven't been translated because even in Chinese, German, those words I marked in red, are in English. image

On a side note, your team should avoid using strings for regular words like category because it removes flexibility when translating. English as a language is very simple, but others are more complicated. Wikipedia says that English has only 3 grammatical cases and Lithuanian has seven.) For example, let's take a house. image

So when I get string to translate Assets in :name :type, I can't make it to look nice - I end up with broken Lithuanian. It would be much easier if string was Assets in :name category (Turtas kategorijoje :name) I'd say translators of other languages (Ukrainian, russian) are in the same boat as me.

snipe commented 3 months ago

https://crowdin.com <- getting a 403 on them right now so I can't check any further :(

Crowdin
Crowdin | Localization Management Platform for agile teams
Crowdin's localization management platform is a technology solution for your team.
snipe commented 3 months ago

Huh. CrowdIn isn't down, it was giving me a forbidden issue when I was running over my VPN. You'd think a company that specializes in localization would understand that people travel and use VPNs. :-/

snipe commented 3 months ago

On a side note, your team should avoid using strings for regular words like category because it removes flexibility when translating.

That's why we use the :type variable in the translation, passing it the translated word for category. If the translators need to move those variables around in the translation to make the sentence make sense, they can (and do.)

swift2512 commented 3 months ago

On a side note, your team should avoid using strings for regular words like category because it removes flexibility when translating.

That's why we use the :type variable in the translation, passing it the translated word for category. If the translators need to move those variables around in the translation to make the sentence make sense, they can (and do.)

If :type = Category, then in Lithuanian you can move this :type around however you want, but you will end up with broken translation.

Category = Kategorija In the Category = Kategorijoje That's why it would be better to use category instead of :type :) If string was 'Assets in :name Category' it would be already translated to 'Turtas kategorijoje :name', but I can't stray that far from the source string. :)

snipe commented 3 months ago

I've already simplified it per the PR that was merged