{"id":19777469,"url":"https://github.com/ilib-js/ilib-loctool-samples","last_synced_at":"2025-09-17T23:52:13.074Z","repository":{"id":40434513,"uuid":"378821895","full_name":"iLib-js/ilib-loctool-samples","owner":"iLib-js","description":"Sample apps for checking  loctool operation per type","archived":false,"fork":false,"pushed_at":"2025-02-17T12:44:26.000Z","size":363,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-17T13:38:33.703Z","etag":null,"topics":["localization"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iLib-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-21T05:56:11.000Z","updated_at":"2025-02-05T17:32:34.000Z","dependencies_parsed_at":"2024-02-21T08:30:02.863Z","dependency_job_id":"5d572893-3421-4af6-84fc-fa1d2fc35446","html_url":"https://github.com/iLib-js/ilib-loctool-samples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-loctool-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-loctool-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-loctool-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-loctool-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iLib-js","download_url":"https://codeload.github.com/iLib-js/ilib-loctool-samples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241107734,"owners_count":19910975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["localization"],"created_at":"2024-11-12T05:25:09.155Z","updated_at":"2025-09-17T23:52:13.042Z","avatar_url":"https://github.com/iLib-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ilib-loctool-samples\n\nThis project contains sample projects of various types\nthat can each be localized with the ilib loctool. Use these as\nthe basis to start your own project. You can also try running\n`loctool init` to create a small starter project.json file to get\nyour localization project off the ground.\n\n## Trying Them Out\n\nEach subdirectory is a project that contains a `package.json`\nfile which depends on the loctool plus whatever plugins are\nnecessary to localize that project. The scripts in that\n`package.json` all have the same targets:\n\n- loc - run the localization tool on this project\n- debug - run the localization tool on this project with the\nchrome debugging tools. Open `chrome://inspect/#devices` in\nchrome and click on \"Open dedicated DevTools for Node\" to watch\nthe localization tool running in the debugger.\n- clean - clean up the localization results so that you can\nrun it all again.\n\nFor each subdirectory, run the loctool with:\n\n```\n$ npm install\n$ npm run loc\n```\n\nThen view the results. The output goes into different directories,\ndepending on how the type of the project.\n\nFor some of the directories, you can even run the sample to see how\nit works. Use `npm run test` to see the output.\n\n## Sample Translations\n\nEach subdirectory contains an \"xliffs\" directory that contains the\ntranslations for that project. The translations are usually partial\ntranslations so that you can see what happens to things that are\nnot translated. For projects where the source file is copied and\ntranslated, such as HTML or markdown, the untranslated strings usually\nappear in the translated file written in the source language English.\nFor projects which use resource files, the untranslated strings\nare usually left out. For both types of projects, the new strings\nwill appear in a `[projectname]-new-[locale].xliff` file in the root\nwhich you can send to your translators. See the [documentation](https://github.com/ilib-js/loctool)\nfor the loctool for more details on how to do a localization cycle.\n\n## What Project Types are Available?\n\n- android - a sample Android mobile app project. The source strings\nare in `res/values/strings.xml` and `res/layout/t1.xml`, and the output\ngoes into `res/values-[locale]/strings.xml`\n\n- js - a sample project containing JavaScript files to translate.\nThe source files are in `src/*.js` and\nthe output goes into `resources/[locale].js`.\n\n- js-json - a sample project containing JavaScript files to translate\nand where the output is ilib-style json files.\nThe source files are in `src/*.js` and\nthe output goes into `resources/[localeDir]/strings.json`.\n\n- markdown - a sample project containing Github-flavored markdown\nfiles to translate. The source file is in `md/en-US/README.md` and\nthe output goes into `locale/[locale]/README.md`.\n\n- php-resource - a sample project that shows how to use the PHP resource\nplugin. The source file are written in Javascript (we don't have a php\nplugin yet, so we needed some easy source of strings for now) and the output\ngoes into `resources/Strings[locale].php`.\n\n- po - a sample project containing po\nfiles to translate. The source file is in `src/*.po` and\nthe output goes into `resources/[locale].po`.\n\n- salesforce - a sample project containing a sales for apex app\nto translate. It contains the main translation-meta.xml as well\nas a number of other meta xml files that contain the source\nstrings. All sources are in force-app, and the output goes\nto `force-app/main/default/translations/[locale].translation-meta.xml`\n\n- xml - a sample project containing xml files to translate. This\nplugin can parse arbitrary xml files given a schema definition\nin json format. (The xml is converted to json first, and then\nparsed.) The source files are in `xml` and the localized\nxml files go into the same directory. The sample files include\nsome Android xml files as well as a Java xml properties file.\n\n## Mixing and Matching\n\nMost projects are not homogeneous. For example, you may have a single\nproject that contains both your Android and your iOS app at the\nsame time. Or, it contains a webapp with both a front end in React\nand a backend in Python, and a documentation directory full of\nmarkdown files. With the loctool, you can create a project\nthat includes all the plugins at the same time to support all of\nthose file types. Merge the settings for each of the plugins into\none project.json and make sure the mappings are set correctly so\nthat you can apply the correct settings to the right files.\n\n# License\n\nCopyright (c) 2021-2025, JEDLSoft\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filib-js%2Filib-loctool-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filib-js%2Filib-loctool-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filib-js%2Filib-loctool-samples/lists"}