Skip to content

Instantly share code, notes, and snippets.

@jonpitch
Created August 26, 2016 18:26
Show Gist options
  • Save jonpitch/af7dcd0e74e5023234a82fde61a90047 to your computer and use it in GitHub Desktop.
Save jonpitch/af7dcd0e74e5023234a82fde61a90047 to your computer and use it in GitHub Desktop.
Translation config
<?php
/**
* Translation definitions of what data is pushed to Crowdin.
* The languages table drives what languages are supported.
*
* Expected format:
* 'base table name' => [
* 'tl' => 'the translation content table',
* 'path' => 'where the content should live in Crowdin'
* 'data' => [
* [
* 'id' => 'helper text to describe the column',
* 'description' => 'context provided to the translator',
* 'column' => 'the database column name'
* ]
* ],
* 'dependencies' => []
* ]
*
* dependencies are only one level deep and should take the same format.
* this is additional content to send for better context.
*
*/
return [
'tables' => [
// Impact Area translations
'impact_area__c' => [
'tl' => 'impact_area_tl__c',
'path' => '/Impact Areas/',
'data' => [
[
'id' => 'name',
'description' => 'This is the impact area name',
'column' => 'name'
],
[
'id' => 'description',
'description' => 'This is the description of the impact area',
'column' => 'description__c'
],
],
'dependencies' => []
],
// Impact Knowledge translations
'impactknowledge__c' => [
'tl' => 'impactknowledge_tl__c',
// note this will be broken down further by type of knowledge.
// for example: /Impact Knowledge/Explain This/
'path' => '/Impact Knowledge/',
'data' => [
[
'id' => 'title',
'description' => 'This is the impact knowledge title',
'column' => 'title__c'
],
[
'id' => 'body',
'description' => 'This helps describe the impact knowledge',
'column' => 'body__c'
],
[
'id' => 'source',
'description' => 'This is the source of the impact knowledge',
'column' => 'source_text__c'
],
],
'dependencies' => []
],
// Impact Section Tree translations
'impact_section_tree' => [
'tl' => 'impact_section_tree_tl',
'path' => '/Impact Tree/',
'data' => [
[
'id' => 'name',
'description' => 'This is the name of the tree header',
'column' => 'name'
],
],
'dependencies' => []
],
// Impact Topic tranlsations
'impact_topic__c' => [
'tl' => 'impact_topic_tl__c',
'path' => '/Impact Topics/',
'data' => [
[
'id' => 'name',
'description' => 'This is the impact topic name',
'column' => 'name'
],
[
'id' => 'description',
'description' => 'This is the description of the impact topic',
'column' => 'description__c'
],
],
'dependencies' => []
],
// Metric Set translations
'metric_set__c' => [
'tl' => 'metric_set_tl__c',
'path' => '/Metric Sets/',
'data' => [
[
'id' => 'name',
'description' => 'This is the impact area name',
'column' => 'name'
],
[
'id' => 'description',
'description' => 'This is the description of the impact area',
'column' => 'description__c'
],
[
'id' => 'header',
'description' => 'This is a display name of the metric set',
'column' => 'header_name__c'
],
],
'dependencies' => []
],
// Partner translations
'funds__c' => [
'tl' => 'funds_tl__c',
'path' => '/Partners/',
'data' => [
[
'id' => 'welcome message',
'description' => 'This is the welcome message shown to partner users',
'column' => 'partner_registration_welcome__c'
],
],
'dependencies' => []
],
// Picklist translations
'crm_picklist_data' => [
'tl' => 'crm_picklist_data',
'path' => '/Picklist/',
'data' => [
[
'id' => 'label',
'description' => 'This is the picklist label',
'column' => 'label'
],
],
'dependencies' => []
],
// Question translations
'question__c' => [
'tl' => 'question_tl__c',
// Note that this is a special case, and will be broken out by
// quick impact, full impact. For example:
// /Questions/Full Impact Assessment/
'path' => '/Questions/',
'data' => [
[
'id' => 'summary',
'description' => 'This is the question summary',
'column' => 'summary__c'
],
[
'id' => 'question',
'description' => 'This is the question',
'column' => 'label__c'
],
[
'id' => 'guidance',
'description' => 'This is the question guidance',
'column' => 'guidance__c'
],
],
'dependencies' => [
'question_group__c' => [
'tl' => 'question_group_tl__c',
'data' => [
[
'id' => 'question-group-*id*',
'description' => 'This describes a collection of similar questions',
'column' => 'question_group_label__c'
],
],
],
'answer_value__c' => [
'tl' => 'answer_value_tl__c',
'data' => [
[
'id' => 'answer-value-*id*',
'description' => 'answer option',
'column' => 'label__c'
],
],
]
]
],
]
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment