# Versioning

{% embed url="<https://www.youtube.com/watch?v=Co0znTx9as8>" %}
[versioning](https://www.youtube.com/watch?v=TFV_vhJs5DY\&t=675s) part of [showcase/demo](https://www.youtube.com/watch?v=TFV_vhJs5DY)
{% endembed %}

## No Versioning

You can use without versioning - just using the default *latest* set of resources. For smaller projects with continues deployment or no deployment process at all this can be a suitable solution.

## "Rolling" Versioning

Most bigger projects will do a versioning divided into stages like:

&#x20;development (latest) → staging → production

Everytime you want to deploy to next stage you can copy the resources eg. from *latest* to *staging* by creating a new version (and retype staging for new version name).

## Semantic Versioning

Semantic Versioning can be useful if you deploy an application in different versions and you got no control over the users upgrading (eg. iOS Applications,…).

&#x20;1.0.0 → patch (bugfix) → 1.0.1\
&#x20;1.0.1 → minor (feature) → 1.1.0\
&#x20;1.1.0 → major (breaking) → 2.0.0

When deploying - just create a new version based on your lastest version and update your production code to use that new version.

&#x20;**development** → use **latest**\
&#x20;published **1.0.0** → use **1.0.0**\
&#x20;published **1.1.0** → use **1.1.0**\
&#x20;published **1.1.1** → keep using **1.1.0** if no changes

Most time you won't need to create a new version when doing bugfix.

{% hint style="warning" %}
Prevent to create versions based on timestamps. You should not have hundreds of versions.
{% endhint %}

## Merging Versions

To make it simple lets say we got two versions:

* **latest** -> is the current WIP / development version
* **production** -> is the current production version

There are two options to keep versions in syn&#x63;*:*

![on your project settings page](/files/2h42xYEN7lNelWEuvA6P)

#### a) “OVERWRITE WITH DATA FROM”

When going to **production** version with the current state go to the versions menu and choose *“OVERWRITE VERSION”* and choose the latest version.\
All content of production version will be overwritten with the content of latest version.\
\&#xNAN;*OVERWRITE is faster than COPY TO.*

#### b) “COPY TO”

Choose *“COPY  CONTENT FROM/TO VERSION”* on **latest** version and choose production version.\
Everything that has a different value in latest version or does not exist in production version gets copied over to production version.\
You will see what changes before you can choose to save or discard.\
\&#xNAN;*COPY TO is slower than OVERWRITE.*\
\&#xNAN;*The changes cause modification costs.*

{% hint style="info" %}
Check out [this section in the video](https://youtu.be/ds-yEEYP1Ks?t=820) to see how this can be used.
{% endhint %}

{% hint style="warning" %}
**Be aware: Adding, deleting or renaming languages influences all versions!**
{% endhint %}

{% hint style="success" %}
With the "COPY TO" option there is also the possibility to fine tune it with the "expert mode":

<img src="/files/UAIXphgpvVjTKF2nIMcg" alt="" data-size="original">
{% endhint %}

## Update your code

Update your [locizify](https://github.com/locize/locizify) script to include targeted version:

```markup
<script id="locizify" version="staging" ...
  src="https://unpkg.com/locizify@^6.0.9" />
```

Update i18next with [locize backend](https://github.com/locize/i18next-locize-backend):

```javascript
i18next.init({
  // ...
  backend: {
    referenceLng: '{{referenceLanguage}}',
    apiKey: '{{apiKey}}', // you should not expose your api key in production...
    version: 'staging',
    projectId: '{{project_Id}}'
  }
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-old.locize.com/more/versioning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
