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

New video, microphone & mute icons #315

Merged
merged 19 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 13 additions & 15 deletions .github/keywords/keywords-generator.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import os
import json
import openai
import subprocess
from openai import OpenAI
from dotenv import load_dotenv

# Load environment variables from the .env file
load_dotenv()

# Set up the OpenAI API key
openai.api_key = os.getenv("OPENAI_API_KEY")
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

# Path to the main folder (the "icons" folder)
main_folder = "./icons"

# JSON file where synonyms will be stored
synonyms_json_file = "icons/icons-keywords.json"
synonyms_json_file = "./icons/icons-keywords.json"

# Load the JSON file if it already exists
if os.path.exists(synonyms_json_file):
Expand Down Expand Up @@ -42,22 +42,20 @@ def list_concepts(folder):
def generate_synonyms(concept):
prompt = f"Generate 12 synonyms for the concept '{concept}' mixing English, Spanish, Portuguese, and German (in this order). Return them as a plain list of words, without quotes, numbering, or separation by language. the order of the synonyms should be English, Spanish, Portuguese, and German. For example: alert lamp cross, warning light plus, signal illumination cross, luz de alarma cruz, luz de advertencia plus, iluminación de señal cruz, Alarmleuchte Kreuz, Warnlicht plus, Signalbeleuchtung Kreuz"

response = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt}
],
max_tokens=100,
temperature=0.7,
)

response = client.chat.completions.create(model="gpt-4",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt}
],
max_tokens=100,
temperature=0.7)

# Get the generated response
raw_synonyms = response['choices'][0]['message']['content'].strip()
raw_synonyms = response.choices[0].message.content.strip()

# Clean the output, removing unnecessary characters and convert it to a list
synonyms = [synonym.strip(' "[]') for synonym in raw_synonyms.split(',')]

return synonyms

# Get concepts from the icons folder
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/keywords-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: Get branch name
uses: rlespinasse/[email protected]
- name: Checkout branch or create new one
run: |
git fetch
if git branch -a | grep origin/import-figma-icons; then
git checkout import-figma-icons
else
git checkout -b import-figma-icons
fi

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -39,19 +45,14 @@ jobs:
- name: Run keywords generator
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
working-directory: .github/keywords
run: python3 keywords-generator.py

- name: Check for changes
id: git_status
run: |
git diff --exit-code || echo "changes"
run: python3 .github/keywords/keywords-generator.py

- name: Commit & Push in ${{ env.GITHUB_REF_SLUG_URL }}
if: steps.git_status.outputs.result == 'changes'
- name: Commit & Push
env:
GITHUB_TOKEN: ${{ secrets.NOVUM_PRIVATE_REPOS }}
run: |
git add .
git config user.name "github-actions"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "update changelog"
git push origin ${{ env.GITHUB_REF_SLUG_URL }}
git add .
git commit -m "Icons keywords autogenerated"
git push origin import-figma-icons
44 changes: 28 additions & 16 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions icons/icons-keywords.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@
"menu": ["list of options", "navigation", "dropdown", "menú", "menu", "Menü"],
"microchip": ["integrated circuit", "electronic chip", "microcircuit", "microchip integrado", "chip eletrônico", "integrierter Schaltkreis"],
"microphone": ["mic", "audio input", "sound sensor", "micrófono", "microfone", "Mikrofon"],
"microphone-aura": ["microphone vibe", "microphone energy", "microphone atmosphere", "aura de microfono", "energía de microfono", "atmosfera de microfono", "vibe do microfone", "energia do microfone", "atmosfera do microfone", "Mikrofon Aura", "Mikrofon Energie", "Mikrofon Atmosphäre"],
"microphone-aura-disabled": ["microphone-aura-off", "microphone-halo-deactivated", "microphone-glow-disabled", "micrófono-aura-desactivado", "micrófono-halo-apagado", "micrófono-brillo-desactivado", "microfone-aura-desativado", "microfone-halo-desativado", "microfone-brilho-desativado", "Mikrofon-Aura-deaktiviert", "Mikrofon-Halo-abgeschaltet", "Mikrofon-Glow-deaktiviert"],
"microphone-disabled": ["microphone-off", "microphone-muted", "microphone-shut", "micrófono-desactivado", "micrófono-silenciado", "micrófono-apagado", "microfone-desativado", "microfone-mudo", "microfone-desligado", "Mikrofon-deaktiviert", "Mikrofon-stumm", "Mikrofon-ausgeschaltet"],
"millennials": ["generation y", "gen y", "digital natives", "millennials", "millennials", "Millennials"],
"mms": ["multimedia message service", "mms", "servicio de mensajes multimedia", "serviço de mensagens multimídia", "Multimedia-Nachrichtendienst"],
"mobile-add-user": ["add user on mobile", "mobile user addition", "phone user inclusion", "agregar usuario en el móvil", "adicionar usuário móvel", "Benutzer auf dem Handy hinzufügen"],
Expand Down Expand Up @@ -580,6 +583,7 @@
"user-support": ["user assistance", "customer support", "help for users", "soporte de usuario", "suporte ao cliente", "Benutzerunterstützung"],
"video": ["visual", "clip", "footage", "video", "vídeo", "Video"],
"video-camera": ["camcorder", "video recorder", "movie camera", "videocámara", "câmera de vídeo", "Videokamera"],
"video-camera-disabled": ["video-camera-off", "video-camera-inactive", "video-camera-unavailable", "cámara-de-video-inhabilitada", "cámara-de-video-desactivada", "cámara-de-video-indisponible", "câmera-de-vídeo-desativada", "câmera-de-vídeo-inativa", "câmera-de-vídeo-indisponível", "Videokamera-deaktiviert", "Videokamera-inaktiv", "Videokamera-nicht-verfügbar"],
"video-chat": ["video call", "visual communication", "face-to-face call", "videollamada", "chamada de vídeo", "Videoanruf"],
"video-disabled": ["no video", "video turned off", "camera disabled", "video desactivado", "vídeo desativado", "Video deaktiviert"],
"video-surveillance-security": ["security video surveillance", "cctv security", "monitoring system", "vigilancia de seguridad con video", "segurança CCTV", "Videoüberwachungssicherheit"],
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions icons/o2-new/filled/video-camera-disabled-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
1 change: 1 addition & 0 deletions icons/o2-new/light/video-camera-disabled-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
1 change: 1 addition & 0 deletions icons/o2-new/regular/video-camera-disabled-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/telefonica/filled/dna-filled.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion icons/telefonica/filled/dna-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/telefonica/filled/email-filled.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion icons/telefonica/filled/email-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/telefonica/filled/exchange-filled.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion icons/telefonica/filled/exchange-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/telefonica/filled/file-compressed-filled.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion icons/telefonica/filled/file-compressed-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/telefonica/filled/file-css-filled.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion icons/telefonica/filled/file-css-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/telefonica/filled/file-encrypted-filled.pdf
Binary file not shown.
Loading
Loading