loc-sync | Synchronizes localization files between Google Sheets | Internationalization library
kandi X-RAY | loc-sync Summary
kandi X-RAY | loc-sync Summary
Synchronizes localization files between Google Sheets and a Git repository
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of loc-sync
loc-sync Key Features
loc-sync Examples and Code Snippets
Community Discussions
Trending Discussions on Internationalization
QUESTION
I'm currently working on a web project which heavily utilizes internationalization (i18n) and I have a hard time figuring out how to make sure all languages share exact same keys.
Here's a simple example of src/lang/en.ts
file:
ANSWER
Answered 2022-Apr-15 at 15:19Use keyof typeof someObject
to construct a type from the keys of an object (e.g. the first language strings). Then restrict your other object (the other languages) to have that type as key, and string as value using Record
. So the type you're looking for is Record
. Example:
QUESTION
I am trying to write a simple qml application with language translations using CMake and although the application runs, it never shows translations. I'm on a Linux platform with CMake version 3.22.2 and Qt version 3.15.2 Here is the directory structure:
...ANSWER
Answered 2022-Apr-01 at 16:09That's pretty badly documented stuff which works magically with ready-made example using dedicated qmake configuration parameter embed_translations
. I advice you to take a look into the original example's build dir where .qm files and a special qrc file qmake_qmake_qm_files.qrc
get generated.
You don't need to use QTranslator
unless you want to support dynamic language switch. At startup, QML runtime automatically loads a translation file qml_.qm (qml_xx_XX.qm where xx is ISO639 and XX is optional ISO 3166 code) from the i18n
subdirectory of the root QML file, based on the system language, if it finds one.
You need to get your .qm files to qrc:/qml/i18n/
folder because your main qml file is in qrc:/qml/
.
With CMake
you can do it as follows:
Add a new qrc file, e.g. cmake_qm_files.qrc to your project
QUESTION
I have this validation in a service class:
...ANSWER
Answered 2022-Mar-30 at 03:17From rails guides: https://guides.rubyonrails.org/i18n.html#error-message-interpolation
For absence
the key should be present
:
QUESTION
I'm right now doing a frontend interface in vueJS, and i'm currently working with vuejs 3 and i18n. The implementation of i18n works quite fine the normal way but when I want to use it with the composition API starts the problems.
So what I did. My main.js looks like this:
...ANSWER
Answered 2022-Mar-16 at 06:23You already instantiated i18n
on your app, in main.js
. That's the important bit.
The example presented in docs doesn't necessarily have to be done on the instance defined inside createApp
. It works in any component, as long as you have instantiated i18n on main.(js|ts)
This will work in any component (wherever you need t
):
QUESTION
I have an app used globally and my company is in the process of rebranding itself for some markets.
For example in the U.S. and Canada we are known as "Acme Company", but now we want to be known as "Acme Company" in the U.S. and as "Foo Company in Canada.
Currently our vue-18n translation files are littered with "Acme Company" inside the translations, for example:
...ANSWER
Answered 2022-Mar-15 at 16:27If you need custom behaviour, it's preferable to use custom functions that suit it instead of shimming third-party library that shouldn't be aware of your case.
vue-i18n functions have variadic arguments, some signatures can be discarded for the ease of the implementation. It's cleaner to use another function name to not interfere with library names, but they could be replaced for a drop-in replacement:
QUESTION
I am new to vuejs and doing my project with multi language feature, German and English, but I have problem with data Array of String which is loops through of a lists, and I don't know how to translate it, here's what I meant
...ANSWER
Answered 2021-Nov-22 at 07:52I'd not translate the texts in data()
but instead only include the static translation keys there:
QUESTION
I am using Thymeleaf and have localisation files set up and working fine, but for help I want to show help for the relevant page, so I am passing the page as a fragment variable.
I know I could use a th:switch/case and go through a bunch of options, but surely there is a quicker way?
So far any variation on this:
...ANSWER
Answered 2022-Feb-21 at 06:46What you need is expression preprocessing. You can do it as follows:
QUESTION
I've been following 3 different tutorials for text translation in django, and with none of them my translation has worked, however I was doing exactly the same steps as in the tutorials. Django just doesn't translate my text, it goes without any kind of error. My last try was with this course: https://www.youtube.com/watch?v=AlJ8cGbk8ps. But just to be sure I'm adding my code below
settings.py
...ANSWER
Answered 2022-Feb-16 at 01:15Try add this in your settings.py:
QUESTION
I'm currently working on a project based on Vuetify
. I need to insert a tag and icon inside an internationalization text. Generally, it is easy to insert a variable as below shows,
this.$vuetify.lang.$t('I'm {0}', varirable_name)
but in this way, I cannot insert tag or an icon
, how could I achieve it?
Just like this,
ANSWER
Answered 2022-Feb-14 at 19:20You can use v-html
directive to output raw HTML. It will work for basic tags but won't work for Vuetify's v-tags (for example, v-icon
).
QUESTION
I have a Java program and I'm using i18n
...ANSWER
Answered 2022-Feb-09 at 17:24The limit size of a method is 65535 byte, but you can define as many methods as you need to join as a large array. Obviously you could use ArrayList / addAll / toArray in place of System.arraycopy
here to build longer arrays:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install loc-sync
Set up an SSH key for it on the server you're going to install loc-sync on.
Log in to the Google account associated with your desired Google Sheets.
Browse to the Google Developers Console (https://console.developers.google.com). You may have to perform some initial setup if you've never used the Google Developers Console.
Create a new project.
Under Credentials, "Create credentials," creating a service account. Generate a Service account key as JSON. Save the result.
Note that the resulting service account is associated with an email address (something@appspot.gserviceaccount.com). We will use this later.
Edit the defines in include.php:.
Obtain a linux-based web server Requires PHP (I have version 5.6.29) Requires Java (I have version 1.7.0_101) Requires git (I have version 2.7.3)
Copy include.php, poll_sheets.php and the two .jar files to the same directory, doesn't need to be www-accessible
Copy githook.php to a www-accessible directory of your choice (should match step 3. from "file setup")
Login to your server
Clone your github repository into a directory of your choice. This directory doesn't need to be www-accessible
Install the Google API PHP client in the location of your choice:
Edit the defines in include.php: Define GOOGLE_API_PATH as the path you used in the previous step. Use the full path (do not use ~). The path should end in "src". Define ACCOUNT_EMAIL as the email address associated with your Google account. Change COMMIT_MESSAGE if you like. Don't use quotation marks here. Change PUSH_COMMAND if needed. Define CREDENTIAL_PATH as the path to the credential json file you created in step 2. Change LOG_ENABLE to false if you don't want logging. You should at least leave the logs running until you determine that everything is working. Define GOOGLE_ROOT as the full path to the google drive folder containing all your files, starting at your google drive root Define LOCAL_ROOT as the relative path to all your files in the git repo, starting from include.php's directory Define STORY_SUFFIX as the google drive folder where you store "story" files as opposed to "ui" files Define UI_SUFFIX as the google drive folder where you store non-"story" files (if you don't care about this distinction, just put all your files in the google drive root and then define these both as "") Define WEBHOOK_SECRET as the secret code you picked in step 3. of "file setup"
Edit the data structures in include.php:
Change the $languages array to match the languages you want to watch files for ("name" should match the name of the folder on Google Drive, and "code" should match the name of the folder on Github)
Change the $files array to match the files that exist in your project
Change the $story array so that any files that count as "story" content have keys set to TRUE -- you don't have to explicitly mark anything else (if you don't care about the ui/story distinction just leave this array blank).
Edit githook.php:
Change the path in the require_once call on line 2 to properly point to your include.php
Define LOC_PREFIX to the relative path that gets you to include.php's directory
Add a cron job for poll_sheets.php
On the command line, type crontab -e
Add a new line: 0 * * * * php /path/to/poll_sheets.php (using your actual path, obviously)
That will poll Sheets hourly. If you want to poll every other hour instead, you would use 0 */2 * * *.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page