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

Component for multiple platforms #9196

Open
2 tasks done
PavelMesicek opened this issue May 2, 2023 · 4 comments
Open
2 tasks done

Component for multiple platforms #9196

PavelMesicek opened this issue May 2, 2023 · 4 comments
Assignees
Labels
documentation Improvements or additions to the documentation. good first issue Opportunity for newcoming contributors. hacktoberfest This is suitable for Hacktoberfest. Don’t try to spam. help wanted Extra attention is needed.

Comments

@PavelMesicek
Copy link

Describe the issue

I would like to have only one component for iOS and Android. Currently, we have separate components, and we download a zip file using the wlc client. Then, we unzip the file using a Python script and copy the contents to the corresponding folders in either Android Studio or Xcode. This procedure is not very efficient, so I would like to have only one component that can be downloaded using the wlc client and always in the format that I need.

I know that in the UI, I can customize the language and its formats, but I haven't found a way to do this through the wlc console.

image

Also, I would like to ask you how to create plural strings in the UI.

image

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Setup the weblate.ini file with keys, components, API keys, etc.
  2. Use wlc download --output Output to download the files.
  3. I've tried several other arguments, like --convert or --format, but they haven't worked.
  4. Unzip the files and move them to the correct folders.

Expected behavior

I would like to download strings and xml from one component

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

@PavelMesicek PavelMesicek added the question This is more a question for the support than an issue. label May 2, 2023
@github-actions
Copy link

github-actions bot commented May 2, 2023

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@tomkolp
Copy link
Contributor

tomkolp commented May 2, 2023

I download using api and powershell. This is my sample code:

# Ustawienia
$api_key = "00000000000000000000000000000000000000"
$base_url = "https://weblate.eso-spolszczenie.eu/api"

# Nazwy komponentów i język
$components = @("204987124", "115740052")
$language = "pl"

# Funkcja wyświetlająca powód błędu, jeśli wystąpił
function Show-Error($error) {
    Write-Host "Błąd $($error.Exception.Message):"
    Write-Host $error.Exception.Response.GetResponseStream() | 
        Select-Object -ExpandProperty ReadToEnd | 
        ConvertFrom-Json | 
        Select-Object -ExpandProperty detail
}

# Pobieranie plików dla każdego komponentu
foreach ($component in $components) {
    # Tworzenie adresu URL z parametrami
    $url = "$base_url/translations/eso-spolszczenie/$component/$language/file/?format=csv"
    
    # Nagłówki żądania HTTP
    $header = @{
        "Authorization" = "Token $api_key"
    }
    
    # Pobieranie pliku
    try {
        Invoke-WebRequest -Uri $url -Headers $header -Method Get -OutFile "$component.csv"
    }
    catch {
        Show-Error $_
    }
}

@nijel
Copy link
Member

nijel commented May 3, 2023

I think that two components and translation propagation is the best approach.

Similar topic is described at https://medium.com/@razornfs/using-weblate-as-ssot-in-ios-android-projects-f6a7a2f9bc2f

Maybe we should cover this by the documentation.

@nijel nijel added documentation Improvements or additions to the documentation. hacktoberfest This is suitable for Hacktoberfest. Don’t try to spam. help wanted Extra attention is needed. good first issue Opportunity for newcoming contributors. and removed question This is more a question for the support than an issue. labels May 16, 2023
@github-actions
Copy link

This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.

You can learn about how to get started in our contributors documentation.

@orangesunny orangesunny self-assigned this Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to the documentation. good first issue Opportunity for newcoming contributors. hacktoberfest This is suitable for Hacktoberfest. Don’t try to spam. help wanted Extra attention is needed.
Projects
None yet
Development

No branches or pull requests

4 participants