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

POC: Add supoort for multi language #158

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
generate first language
Carlos Lancha committed Mar 25, 2020
commit 654b94e21efe57ff627da11e5422d870e0f8bb76
4,735 changes: 4,735 additions & 0 deletions languages/en.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -23,8 +23,6 @@ fs.readdir('languages', (err, languageFileNames) => {
srcFiles.forEach(srcFileName => {
let srcFileData = fs.readFileSync(`src/${srcFileName}`, 'utf8');

const srcFileDataJSON = JSON.parse(srcFileData);

Object.entries(languageDataJSON).forEach(entry => {
srcFileData = srcFileData.replace(new RegExp(`"${entry[0]}"`, 'g'), `"${entry[1]}"`);
});
288 changes: 144 additions & 144 deletions src/5e-SRD-Ability-Scores.json
Original file line number Diff line number Diff line change
@@ -1,145 +1,145 @@
[
{
"index": "str",
"name": "STR",
"full_name": "Strength",
"desc": [
"Strength measures bodily power, athletic training, and the extent to which you can exert raw physical force.",
"A Strength check can model any attempt to lift, push, pull, or break something, to force your body through a space, or to otherwise apply brute force to a situation. The Athletics skill reflects aptitude in certain kinds of Strength checks."
],
"skills": [
{
"url": "/api/skills/athletics",
"name": "Athletics"
}
],
"url": "/api/ability-scores/str"
},
{
"index": "dex",
"name": "DEX",
"full_name": "Dexterity",
"desc": [
"Dexterity measures agility, reflexes, and balance.",
"A Dexterity check can model any attempt to move nimbly, quickly, or quietly, or to keep from falling on tricky footing. The Acrobatics, Sleight of Hand, and Stealth skills reflect aptitude in certain kinds of Dexterity checks."
],
"skills": [
{
"url": "/api/skills/acrobatics",
"name": "Acrobatics"
},
{
"url": "/api/skills/sleight-of-hand",
"name": "Sleight of Hand"
},
{
"url": "/api/skills/stealth",
"name": "Stealth"
}
],
"url": "/api/ability-scores/dex"
},
{
"index": "con",
"name": "CON",
"full_name": "Constitution",
"desc": [
"Constitution measures health, stamina, and vital force.",
"Constitution checks are uncommon, and no skills apply to Constitution checks, because the endurance this ability represents is largely passive rather than involving a specific effort on the part of a character or monster."
],
"skills": [],
"url": "/api/ability-scores/con"
},
{
"index": "int",
"name": "INT",
"full_name": "Intelligence",
"desc": [
"Intelligence measures mental acuity, accuracy of recall, and the ability to reason.",
"An Intelligence check comes into play when you need to draw on logic, education, memory, or deductive reasoning. The Arcana, History, Investigation, Nature, and Religion skills reflect aptitude in certain kinds of Intelligence checks."
],
"skills": [
{
"url": "/api/skills/arcana",
"name": "Arcana"
},
{
"url": "/api/skills/history",
"name": "History"
},
{
"url": "/api/skills/investigation",
"name": "Investigation"
},
{
"url": "/api/skills/nature",
"name": "Nature"
},
{
"url": "/api/skills/religion",
"name": "Religion"
}
],
"url": "/api/ability-scores/int"
},
{
"index": "wis",
"name": "WIS",
"full_name": "Wisdom",
"desc": [
"Wisdom reflects how attuned you are to the world around you and represents perceptiveness and intuition.",
"A Wisdom check might reflect an effort to read body language, understand someone's feelings, notice things about the environment, or care for an injured person. The Animal Handling, Insight, Medicine, Perception, and Survival skills reflect aptitude in certain kinds of Wisdom checks."
],
"skills": [
{
"url": "/api/skills/animal-handling",
"name": "Animal Handling"
},
{
"url": "/api/skills/insight",
"name": "Insight"
},
{
"url": "/api/skills/medicine",
"name": "Medicine"
},
{
"url": "/api/skills/perception",
"name": "Perception"
},
{
"url": "/api/skills/survival",
"name": "Survival"
}
],
"url": "/api/ability-scores/wis"
},
{
"index": "cha",
"name": "CHA",
"full_name": "Charisma",
"desc": [
"Charisma measures your ability to interact effectively with others. It includes such factors as confidence and eloquence, and it can represent a charming or commanding personality.",
"A Charisma check might arise when you try to influence or entertain others, when you try to make an impression or tell a convincing lie, or when you are navigating a tricky social situation. The Deception, Intimidation, Performance, and Persuasion skills reflect aptitude in certain kinds of Charisma checks."
],
"skills": [
{
"url": "/api/skills/deception",
"name": "Deception"
},
{
"url": "/api/skills/intimidation",
"name": "Intimidation"
},
{
"url": "/api/skills/performance",
"name": "Performance"
},
{
"url": "/api/skills/persuasion",
"name": "Persuasion"
}
],
"url": "/api/ability-scores/cha"
}
]
{
"index": "str",
"name": "LANG-KEY-str",
"full_name": "LANG-KEY-strength",
"desc": [
"LANG-KEY-strength-measures-bodily-power-athletic-training-and-the-extent-to-which-you-can-exert-raw-physical-force",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these things instead be something like LANG-KEY-strength-description and store that as a list instead? A key like what we have right now seems a bit silly.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably make your hash in en.json be a little less ridiculious? Maybe?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these things instead be something like LANG-KEY-strength-description and store that as a list instead? A key like what we have right now seems a bit silly.

Yes, this is totally what should happen. Having such big keys can be problematic on several fronts. The first and obvious one is that if typos are put in there, or on the contrary, fixed, we have to stick with what existed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to keep the values the same type for everything, then the keys can instead be LANG-KEY-strength-description-#, where # is the index.

"LANG-KEY-a-strength-check-can-model-any-attempt-to-lift-push-pull-or-break-something-to-force-your-body-through-a-space-or-to-otherwise-apply-brute-force-to-a-situation-the-athletics-skill-reflects-aptitude-in-certain-kinds-of-strength-checks"
],
"skills": [
{
"url": "/api/skills/athletics",
"name": "LANG-KEY-athletics"
}
],
"url": "/api/ability-scores/str"
},
{
"index": "dex",
"name": "LANG-KEY-dex",
"full_name": "LANG-KEY-dexterity",
"desc": [
"LANG-KEY-dexterity-measures-agility-reflexes-and-balance",
"LANG-KEY-a-dexterity-check-can-model-any-attempt-to-move-nimbly-quickly-or-quietly-or-to-keep-from-falling-on-tricky-footing-the-acrobatics-sleight-of-hand-and-stealth-skills-reflect-aptitude-in-certain-kinds-of-dexterity-checks"
],
"skills": [
{
"url": "/api/skills/acrobatics",
"name": "LANG-KEY-acrobatics"
},
{
"url": "/api/skills/sleight-of-hand",
"name": "LANG-KEY-sleight-of-hand"
},
{
"url": "/api/skills/stealth",
"name": "LANG-KEY-stealth"
}
],
"url": "/api/ability-scores/dex"
},
{
"index": "con",
"name": "LANG-KEY-con",
"full_name": "LANG-KEY-constitution",
"desc": [
"LANG-KEY-constitution-measures-health-stamina-and-vital-force",
"LANG-KEY-constitution-checks-are-uncommon-and-no-skills-apply-to-constitution-checks-because-the-endurance-this-ability-represents-is-largely-passive-rather-than-involving-a-specific-effort-on-the-part-of-a-character-or-monster"
],
"skills": [],
"url": "/api/ability-scores/con"
},
{
"index": "int",
"name": "LANG-KEY-int",
"full_name": "LANG-KEY-intelligence",
"desc": [
"LANG-KEY-intelligence-measures-mental-acuity-accuracy-of-recall-and-the-ability-to-reason",
"LANG-KEY-an-intelligence-check-comes-into-play-when-you-need-to-draw-on-logic-education-memory-or-deductive-reasoning-the-arcana-history-investigation-nature-and-religion-skills-reflect-aptitude-in-certain-kinds-of-intelligence-checks"
],
"skills": [
{
"url": "/api/skills/arcana",
"name": "LANG-KEY-arcana"
},
{
"url": "/api/skills/history",
"name": "LANG-KEY-history"
},
{
"url": "/api/skills/investigation",
"name": "LANG-KEY-investigation"
},
{
"url": "/api/skills/nature",
"name": "LANG-KEY-nature"
},
{
"url": "/api/skills/religion",
"name": "LANG-KEY-religion"
}
],
"url": "/api/ability-scores/int"
},
{
"index": "wis",
"name": "LANG-KEY-wis",
"full_name": "LANG-KEY-wisdom",
"desc": [
"LANG-KEY-wisdom-reflects-how-attuned-you-are-to-the-world-around-you-and-represents-perceptiveness-and-intuition",
"LANG-KEY-a-wisdom-check-might-reflect-an-effort-to-read-body-language-understand-someones-feelings-notice-things-about-the-environment-or-care-for-an-injured-person-the-animal-handling-insight-medicine-perception-and-survival-skills-reflect-aptitude-in-certain-kinds-of-wisdom-checks"
],
"skills": [
{
"url": "/api/skills/animal-handling",
"name": "LANG-KEY-animal-handling"
},
{
"url": "/api/skills/insight",
"name": "LANG-KEY-insight"
},
{
"url": "/api/skills/medicine",
"name": "LANG-KEY-medicine"
},
{
"url": "/api/skills/perception",
"name": "LANG-KEY-perception"
},
{
"url": "/api/skills/survival",
"name": "LANG-KEY-survival"
}
],
"url": "/api/ability-scores/wis"
},
{
"index": "cha",
"name": "LANG-KEY-cha",
"full_name": "LANG-KEY-charisma",
"desc": [
"LANG-KEY-charisma-measures-your-ability-to-interact-effectively-with-others-it-includes-such-factors-as-confidence-and-eloquence-and-it-can-represent-a-charming-or-commanding-personality",
"LANG-KEY-a-charisma-check-might-arise-when-you-try-to-influence-or-entertain-others-when-you-try-to-make-an-impression-or-tell-a-convincing-lie-or-when-you-are-navigating-a-tricky-social-situation-the-deception-intimidation-performance-and-persuasion-skills-reflect-aptitude-in-certain-kinds-of-charisma-checks"
],
"skills": [
{
"url": "/api/skills/deception",
"name": "LANG-KEY-deception"
},
{
"url": "/api/skills/intimidation",
"name": "LANG-KEY-intimidation"
},
{
"url": "/api/skills/performance",
"name": "LANG-KEY-performance"
},
{
"url": "/api/skills/persuasion",
"name": "LANG-KEY-persuasion"
}
],
"url": "/api/ability-scores/cha"
}
]
Loading