Habitica: Remove duplicate I18N strings

Created on 17 Oct 2017  Â·  32Comments  Â·  Source: HabitRPG/habitica

Description

As reported by @paglias in our internal bug tracking doc:

lots of unused / duplicate i18n strings. Should write an automated scripti for this.

We should remove duplicate strings used for the same meaning. E.g. https://github.com/HabitRPG/habitica/pull/9191/commits/1717c2a5df3e649764d224eeee780f7b07d0cb24 - removed headGear because we had headgearCapitalized already. Word of caution! There are places where the same English text is used but it's used for different meanings of the word, and thus can be translated differently. E.g. text ("Title", meaning the heading text for a task) vs. title ("Title" meaning someone's contributor label).

good first issue help wanted minor other translations

All 32 comments

Can we break this into separate issues for each of the three points, or make a rule that there's to be only N fixes per PR as we did for the apidocs issue? I dread getting a PR with ALL THE FIXES and having to review it for the translation caveat in point 1. :) That one is especially important because it can significantly mess up the meanings for non-English speakers.

Yeah, that makes sense! Do you have a preference on which way to handle it?

I think a different issue for each point might be best since they'll need different strategies to fix them.

Hey, new here. Would I be able to tackle one or more of these?

@Inshabel Yes, thank you, that would be great! Which part(s) would you like to work on? If you'd like to do more than one part, I suggest creating a separate pull request for each. I think that's likely to make it easier (and hence faster) for us to review them.

Just so you know, you don't need to provide your email address for most issues, and I've edited your comment here to delete it in case you'd prefer to keep it private. :) The only time staff ask for your email address is when Zeplin has been used to define how a portion of the website should look, and your email address is then needed to give you access to Zeplin.

Ah okay, thanks for that.

I might start with the "remove strings that are not used anywhere" and once I get something done, I'll move to one of the others (Just to keep it simple for my first time). If that's cool.

That sounds like a good place to start! Go ahead and tell us if you have
questions.

On Tue, 2 Jan 2018, 13:18 Inshabel notifications@github.com wrote:

Ah okay, thanks for that.

I might start with the "remove strings that are not used anywhere" and
once I get something done, I'll move to one of the others (Just to keep it
simple for my first time). If that's cool.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/HabitRPG/habitica/issues/9210#issuecomment-354697812,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABbTAWRh0ALv4kuj3OmuIIRM-SCVLrKjks5tGaAPgaJpZM4P8zkO
.

Hey sorry, it's been a while. Have been finishing up another project. Getting stuck into this now but just had a question. I'm using VS Code and due to the way things are laid out, having some trouble finding an efficient way of navigating to variable implementations without checking them all manually. Any suggestions or better IDE's for doing that in?

Unfortunately there isn't an IDE that helps given the way our strings are setup :(

Do we need to consider the Android and iOS repos when searching for string usage? I.e., does the source code for the apps use any of the website's strings directly? @vIiRuS

If the apps use the strings only indirectly in messages that are returned by the API, then we don't need to search in those repos.

I think apps manage their own strings

The apps don‘t use any of the strings from this repo directly. They only
use the content and response strings from the api

--
Phillip Thelen
Sent with Airmail

On 3. February 2018 at 12:06:23, Alys ([email protected]) wrote:

Do we need to consider the Android and iOS repos when searching for string
usage? I.e., does the source code for the apps use any of the website's
strings directly? @vIiRuS https://github.com/viirus

If the apps use the strings only indirectly in messages that are returned
by the API, then we don't need to search in those repos.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/HabitRPG/habitica/issues/9210#issuecomment-362798353,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AASMTlf4YDXNDZF002aghjyWwQn52aDLks5tRD2ugaJpZM4P8zkO
.

Hey thanks for the reply, found a work around that should speed things up using VS2017 :)

Oh, looks like I never got around to breaking this up. Let me go ahead and do that.

Done. See referenced tickets above.

@Inshabel I've marked https://github.com/HabitRPG/habitica/issues/9957 as in progress for you. You might like to subscribe to notifications for that issue, although it's possible you'll get them automatically since I've mentioned your name there.

Hello there,

Is there still interest in pursuing this issue?

When a string is to be considered duplicated?

  • in relation to the text it contains?
  • its name?
  • both cases?

In what context should the search for duplicates take place?

  • Within a json file (e.g., tasks.json)?
  • In all files within a locales folder simultaneously (e.g., locales\en)?

Thanks in advance!

I did some digging in the source code and saw that this is still a 'valid' issue. I have some ideas on how to solve it and I'd like to give it a try if it's okay with you.

Hi @RaitheOfDureya sorry for the delay, to be honest I'm not sure this issue is worth fixing, a lot of duplicates are probably wanted, do you have a number on how many duplicated strings there are?

No problems, @paglias :smile:
Since I already removed a number of duplicates during the unused string removal process, there are not many left.

I can quickly remove those that are clearly duplicates and make a report to you with different strings to be considered and you can evaluate if it is worth fixing. How does that sound?

Duplicates (Solved with #12679)

website/common/locales/en/generic.json
"creativity": "Creativity",

website/common/locales/en/front.json
"featuredIn": "Featured in",

website/common/locales/en/npc.json
"items": "Items",

website/common/locales/en/groups.json
"possessiveParty": "<%= name %>'s Party",

Similar strings in the same file

website/common/locales/en/challenge.json
"exportChallengeCSV": "Export to CSV",
"exportChallengeCsv": "Export Challenge",

Similar strings in different files

website/common/locales/en/front.json
"FAQ": "FAQ",
website/common/locales/en/groups.json
"faq": "FAQ",

website/common/locales/en/achievements.json
"levelup": "By accomplishing your real life goals, you leveled up and are now fully healed!",
website/common/locales/en/character.json
"levelUp": "Level Up!",

website/common/locales/en/character.json
"offHand": "Off-Hand",
website/common/locales/en/gear.json
"offhand": "off-hand item",

website/common/locales/en/tasks.json
"todo": "To Do",
website/common/locales/en/npc.json
"toDo": "To Do",

website/common/locales/en/front.json
"battleMonsters": "Battle Monsters with Friends",
website/common/locales/en/groups.json
"battleWithFriends": "Battle Monsters With Friends",

Different strings with same content in the same file

website/common/locales/en/generic.json
"habiticaOfficial": "Habitica Official",
"habitica_official": "Habitica Official",

website/common/locales/en/challenge.json
"notParticipating": "Not Participating",
"not_participating": "Not Participating",

website/common/locales/en/front.json
"passConfirm": "Confirm Password",
"confirmPassword": "Confirm Password",

website/common/locales/en/groups.json
"requestFeature": "Request a Feature",
"requestAF": "Request a Feature",

website/common/locales/en/challenge.json
"keepThem": "Keep Tasks",
"keepTasks": "Keep Tasks",

website/common/locales/en/challenge.json
"removeThem": "Remove Tasks",
"removeTasks": "Remove Tasks",

website/common/locales/en/groups.json
"communityGuidelinesLink": "Community Guidelines",
"communityGuidelines": "Community Guidelines",

website/common/locales/en/gear.json
"back": "Back Accessory",
"backCapitalized": "Back Accessory",

website/common/locales/en/gear.json
"body": "Body Accessory",
"bodyCapitalized": "Body Accessory",

website/common/locales/en/gear.json
"eyewear": "Eyewear",
"eyewearCapitalized": "Eyewear",

website/common/locales/en/gear.json
"headAccessory": "head accessory",
"headAccessoryCapitalized": "Head Accessory",

website/common/locales/en/gear.json
"offhand": "off-hand item",
"offhandCapitalized": "Off-Hand Item",

website/common/locales/en/character.json
"optOutOfClasses": "Opt Out",
"optOutOfPMs": "Opt Out",

website/common/locales/en/character.json
"bodyHair": "Hair",
"hair": "Hair",

website/common/locales/en/character.json
"bodySize": "Size",
"size": "Size",

website/common/locales/en/character.json
"photo": "Photo",
"displayPhoto": "Photo",

website/common/locales/en/quests.json
"questDetails": "Quest Details",
"questDetailsTitle": "Quest Details",

website/common/locales/en/generic.json
"market": "Market",
"titleDrops": "Market",

website/common/locales/en/groups.json
"createGroupPlan": "Create",
"create": "Create",
"createGuild2": "Create",
"addTaskToGroupPlan": "Create",

website/common/locales/en/groups.json
"dataDisplayTool": "Data Display Tool",
"dataTool": "Data Display Tool",

website/common/locales/en/groups.json
"description": "Description",
"groupDescription": "Description",

website/common/locales/en/generic.json
"gemsPopoverTitle": "Gems",
"gems": "Gems",

website/common/locales/en/challenge.json
"challengeDetails": "Challenges are community events in which players compete and earn prizes by completing a group of related tasks.",
"challengeDescription1": "Challenges are community events in which players compete and earn prizes by completing a group of related tasks.",

website/common/locales/en/character.json
"bangs": "Bangs",
"hairBangs": "Bangs",

website/common/locales/en/tasks.json
"edit": "Edit",
"editTags": "Edit",

website/common/locales/en/quests.json
"rage": "Rage",
"bossRageTitle": "Rage",

website/common/locales/en/challenge.json
"either": "Either",
"challengedEitherOwnedFilter": "Either",

website/common/locales/en/backgrounds.json
"backgroundShop": "Background Shop",
"backgroundShopText": "Background Shop",

website/common/locales/en/front.json
"mobileAndroid": "Android",
"pkAndroid": "Android",

website/common/locales/en/front.json
"mobileIOS": "iOS",
"pkiOS": "iOS",

Different strings with same content in different files

website/common/locales/en/groups.json
"askAQuestion": "Ask a Question",
website/common/locales/en/generic.json
"askQuestion": "Ask a Question",

website/common/locales/en/groups.json
"inviteToPartyOrQuest": "Invite Party to Quest",
website/common/locales/en/quests.json
"inviteParty": "Invite Party to Quest",

website/common/locales/en/contrib.json
"UUID": "User ID",
website/common/locales/en/groups.json
"userId": "User ID",

website/common/locales/en/messages.json
"messageTaskNotFound": "Task not found.",
website/common/locales/en/tasks.json
"taskNotFound": "Task not found.",

website/common/locales/en/defaultTasks.json
"selfCareDailyNotes": "Tap to choose your schedule!",
"choresDailyNotes": "Tap to choose your schedule!",

website/common/locales/en/character.json
"class": "Class",
website/common/locales/en/gear.json
"klass": "Class",

website/common/locales/en/generic.json
"groupPlansTitle": "Group Plans",
website/common/locales/en/subscriber.json
"groupPlans": "Group Plans",

website/common/locales/en/generic.json
"titleGuilds": "Guilds",
website/common/locales/en/groups.json
"guilds": "Guilds",

website/common/locales/en/generic.json
"titleParty": "Party",
website/common/locales/en/groups.json
"party": "Party",

website/common/locales/en/generic.json
"titleMounts": "Mounts",
website/common/locales/en/pets.json
"mounts": "Mounts",

website/common/locales/en/generic.json
"titleProfile": "Profile",
website/common/locales/en/character.json
"profile": "Profile",

website/common/locales/en/generic.json
"titleSeasonalShop": "Seasonal Shop",
website/common/locales/en/limited.json
"seasonalShop": "Seasonal Shop",

website/common/locales/en/generic.json
"titleSettings": "Settings",
website/common/locales/en/settings.json
"settings": "Settings",

website/common/locales/en/generic.json
"titleQuests": "Quests",
website/common/locales/en/quests.json
"quests": "Quests",

website/common/locales/en/generic.json
"reportBug": "Report a Bug",
website/common/locales/en/groups.json
"reportProblem": "Report a Bug",

website/common/locales/en/communityGuidelines.json
"commGuideHeadingPublicGuilds": "Public Guilds",
website/common/locales/en/groups.json
"publicGuilds": "Public Guilds",

website/common/locales/en/challenge.json
"noNone": "None",
website/common/locales/en/generic.json
"none": "None",

website/common/locales/en/character.json
"health": "Health",
website/common/locales/en/front.json
"wellness": "Health",

website/common/locales/en/front.json
"school": "School",
website/common/locales/eo/defaulttasks.json
"defaultTag4": "School",

website/common/locales/en/generic.json
"titleInbox": "Inbox",
website/common/locales/en/groups.json
"inbox": "Inbox",

website/common/locales/en/generic.json
"done": "Done",
website/common/locales/en/tasks.json
"complete": "Done",

website/common/locales/en/contrib.json
"hall": "Hall of Heroes",
website/common/locales/en/generic.json
"titleHeroes": "Hall of Heroes",

website/common/locales/en/contrib.json
"hallPatrons": "Hall of Patrons",
website/common/locales/en/generic.json
"titlePatrons": "Hall of Patrons",

website/common/locales/en_GB/defaulttasks.json
"defaultTag7": "Creativity",
website/common/locales/en/generic.json
"creativity": "Creativity",

website/common/locales/en/challenge.json
"challenges": "Challenges",
website/common/locales/en/generic.json
"titleChallenges": "Challenges",

website/common/locales/en/backgrounds.json
"backgrounds": "Backgrounds",
website/common/locales/en/generic.json
"titleBackgrounds": "Backgrounds",

website/common/locales/en/front.json
"chores": "Chores",
website/common/locales/en/defaultTasks.json
"defaultTag6": "Chores",

website/common/locales/en/generic.json
"titleAchievs": "Achievements",
"achievements": "Achievements",
website/common/locales/en/character.json
"achievs": "Achievements",

website/common/locales/en/character.json
"equipment": "Equipment",
"equipmentBonus": "Equipment",
website/common/locales/en/generic.json
"titleEquipment": "Equipment",

website/common/locales/en/defaultTasks.json
"defaultTag2": "Exercise",
website/common/locales/en/generic.json
"exercise": "Exercise",

website/common/locales/en/loginIncentives.json
"awesome": "Awesome!",
website/common/locales/en/npc.json
"tourAwesome": "Awesome!",

website/common/locales/en/pets.json
"eggs": "Eggs",
website/common/locales/en/inventory.json
"eggsItemType": "Eggs",

website/common/locales/en/front.json
"playButtonFull": "Enter Habitica",
website/common/locales/en/npc.json
"imReady": "Enter Habitica",

website/common/locales/en/challenge.json
"addTaskToChallenge": "Add Task",
"addTask": "Add Task",
website/common/locales/en/tasks.json
"addTaskToUser": "Add Task",

Different strings with similar content

website/common/locales/en/achievements.json
"achievement": "Achievement",
"modalAchievement": "Achievement!",

website/common/locales/en/gear.json
"backBase0Text": "No Back Accessory",
"backBase0Notes": "No Back Accessory.",

website/common/locales/en/gear.json
"bodyBase0Text": "No Body Accessory",
"bodyBase0Notes": "No Body Accessory.",

website/common/locales/en/gear.json
"eyewearBase0Text": "No Eyewear",
"eyewearBase0Notes": "No Eyewear.",

Strings content that could be improved

In the website/common/locales/be/content.json file several of the strings questXText and questXMountText have the same value:

e.g.,
"questEggAlligatorText": "Alligator",
"questEggAlligatorMountText": "Alligator",

"questEggArmadilloText": "Armadillo",
"questEggArmadilloMountText": "Armadillo",

"questEggAxolotlText": "Axolotl",
"questEggAxolotlMountText": "Axolotl",

"questEggBadgerText": "Badger",
"questEggBadgerMountText": "Badger",

...

I know that these strings have different functions, just wanted to point out that its content could be improved instead of simple repetitions.

Like in the strings:
"questEggTurtleText": "Sea Turtle",
"questEggTurtleMountText": "Giant Sea Turtle",

or

"questEggButterflyText": "Caterpillar",
"questEggButterflyMountText": "Butterfly",

@paglias, as I said, I did the PR to remove the clearly duplicated strings, and made a report to make clear where attention is needed.

I leave it to you decide if we should move forward with this issue.

Best regards

@RaitheOfDureya thanks for the report! It might take a while but I'll go through all of them and let you know which one we want to remove

You are welcome, @paglias
I know this issue has a minor priority, so take your time :)

I want in on this as well if it could use another helper ^_^

Hi @Zarrindast thanks for the offer but @RaitheOfDureya is already working on this one, also you've already claimed another issue and we usually discourage new contributors from working on multiple tasks at the same time

Was this page helpful?
0 / 5 - 0 ratings