Add Flags Assets and Update Configuration
- Introduced multiple SVG flag assets to the project, enhancing the visual representation of country flags. - Updated the configuration file to include a new path for the flags assets, ensuring proper access and organization. - Modified the main application to accommodate the new flags path, improving the overall asset management in the application.
This commit is contained in:
@@ -0,0 +1,400 @@
|
||||
package assets
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// CountryCodeMapping maps 3-letter country codes to 2-letter ISO codes
|
||||
var CountryCodeMapping = map[string]string{
|
||||
"POL": "pl", // Poland
|
||||
"GRC": "gr", // Greece
|
||||
"DEU": "de", // Germany
|
||||
"FRA": "fr", // France
|
||||
"ITA": "it", // Italy
|
||||
"ESP": "es", // Spain
|
||||
"GBR": "gb", // United Kingdom
|
||||
"NLD": "nl", // Netherlands
|
||||
"BEL": "be", // Belgium
|
||||
"AUT": "at", // Austria
|
||||
"SWE": "se", // Sweden
|
||||
"DNK": "dk", // Denmark
|
||||
"FIN": "fi", // Finland
|
||||
"NOR": "no", // Norway
|
||||
"IRL": "ie", // Ireland
|
||||
"PRT": "pt", // Portugal
|
||||
"CZE": "cz", // Czech Republic
|
||||
"SVK": "sk", // Slovakia
|
||||
"HUN": "hu", // Hungary
|
||||
"ROU": "ro", // Romania
|
||||
"BGR": "bg", // Bulgaria
|
||||
"HRV": "hr", // Croatia
|
||||
"SVN": "si", // Slovenia
|
||||
"EST": "ee", // Estonia
|
||||
"LVA": "lv", // Latvia
|
||||
"LTU": "lt", // Lithuania
|
||||
"LUX": "lu", // Luxembourg
|
||||
"MLT": "mt", // Malta
|
||||
"CYP": "cy", // Cyprus
|
||||
"USA": "us", // United States
|
||||
"CAN": "ca", // Canada
|
||||
"AUS": "au", // Australia
|
||||
"JPN": "jp", // Japan
|
||||
"CHN": "cn", // China
|
||||
"IND": "in", // India
|
||||
"BRA": "br", // Brazil
|
||||
"RUS": "ru", // Russia
|
||||
"TUR": "tr", // Turkey
|
||||
"UKR": "ua", // Ukraine
|
||||
"EGY": "eg", // Egypt
|
||||
"ZAF": "za", // South Africa
|
||||
"NZL": "nz", // New Zealand
|
||||
"KOR": "kr", // South Korea
|
||||
"THA": "th", // Thailand
|
||||
"SGP": "sg", // Singapore
|
||||
"MYS": "my", // Malaysia
|
||||
"IDN": "id", // Indonesia
|
||||
"PHL": "ph", // Philippines
|
||||
"VNM": "vn", // Vietnam
|
||||
"CHL": "cl", // Chile
|
||||
"ARG": "ar", // Argentina
|
||||
"MEX": "mx", // Mexico
|
||||
"PER": "pe", // Peru
|
||||
"COL": "co", // Colombia
|
||||
"VEN": "ve", // Venezuela
|
||||
"ECU": "ec", // Ecuador
|
||||
"BOL": "bo", // Bolivia
|
||||
"URY": "uy", // Uruguay
|
||||
"PRY": "py", // Paraguay
|
||||
"GUY": "gy", // Guyana
|
||||
"SUR": "sr", // Suriname
|
||||
"ISR": "il", // Israel
|
||||
"SAU": "sa", // Saudi Arabia
|
||||
"ARE": "ae", // United Arab Emirates
|
||||
"QAT": "qa", // Qatar
|
||||
"KWT": "kw", // Kuwait
|
||||
"BHR": "bh", // Bahrain
|
||||
"OMN": "om", // Oman
|
||||
"JOR": "jo", // Jordan
|
||||
"LBN": "lb", // Lebanon
|
||||
"SYR": "sy", // Syria
|
||||
"IRQ": "iq", // Iraq
|
||||
"IRN": "ir", // Iran
|
||||
"AFG": "af", // Afghanistan
|
||||
"PAK": "pk", // Pakistan
|
||||
"BGD": "bd", // Bangladesh
|
||||
"LKA": "lk", // Sri Lanka
|
||||
"MDV": "mv", // Maldives
|
||||
"BTN": "bt", // Bhutan
|
||||
"NPL": "np", // Nepal
|
||||
"MMR": "mm", // Myanmar
|
||||
"LAO": "la", // Laos
|
||||
"KHM": "kh", // Cambodia
|
||||
"BRN": "bn", // Brunei
|
||||
"TLS": "tl", // East Timor
|
||||
"PNG": "pg", // Papua New Guinea
|
||||
"FJI": "fj", // Fiji
|
||||
"TON": "to", // Tonga
|
||||
"WSM": "ws", // Samoa
|
||||
"VUT": "vu", // Vanuatu
|
||||
"SLB": "sb", // Solomon Islands
|
||||
"KIR": "ki", // Kiribati
|
||||
"TUV": "tv", // Tuvalu
|
||||
"NRU": "nr", // Nauru
|
||||
"PLW": "pw", // Palau
|
||||
"FSM": "fm", // Federated States of Micronesia
|
||||
"MHL": "mh", // Marshall Islands
|
||||
"COK": "ck", // Cook Islands
|
||||
"NIU": "nu", // Niue
|
||||
"TKL": "tk", // Tokelau
|
||||
"WLF": "wf", // Wallis and Futuna
|
||||
"ASM": "as", // American Samoa
|
||||
"GUM": "gu", // Guam
|
||||
"MNP": "mp", // Northern Mariana Islands
|
||||
"PRI": "pr", // Puerto Rico
|
||||
"VIR": "vi", // U.S. Virgin Islands
|
||||
"BHS": "bs", // Bahamas
|
||||
"BLZ": "bz", // Belize
|
||||
"CRI": "cr", // Costa Rica
|
||||
"GTM": "gt", // Guatemala
|
||||
"HND": "hn", // Honduras
|
||||
"NIC": "ni", // Nicaragua
|
||||
"PAN": "pa", // Panama
|
||||
"SLV": "sv", // El Salvador
|
||||
"JAM": "jm", // Jamaica
|
||||
"HTI": "ht", // Haiti
|
||||
"DOM": "do", // Dominican Republic
|
||||
"CUB": "cu", // Cuba
|
||||
"TTO": "tt", // Trinidad and Tobago
|
||||
"BRB": "bb", // Barbados
|
||||
"LCA": "lc", // Saint Lucia
|
||||
"VCT": "vc", // Saint Vincent and the Grenadines
|
||||
"GRD": "gd", // Grenada
|
||||
"ATG": "ag", // Antigua and Barbuda
|
||||
"DMA": "dm", // Dominica
|
||||
"KNA": "kn", // Saint Kitts and Nevis
|
||||
"BWA": "bw", // Botswana
|
||||
"ZWE": "zw", // Zimbabwe
|
||||
"ZMB": "zm", // Zambia
|
||||
"MWI": "mw", // Malawi
|
||||
"MOZ": "mz", // Mozambique
|
||||
"MDG": "mg", // Madagascar
|
||||
"MUS": "mu", // Mauritius
|
||||
"SYC": "sc", // Seychelles
|
||||
"COM": "km", // Comoros
|
||||
"DJI": "dj", // Djibouti
|
||||
"ERI": "er", // Eritrea
|
||||
"ETH": "et", // Ethiopia
|
||||
"KEN": "ke", // Kenya
|
||||
"TZA": "tz", // Tanzania
|
||||
"UGA": "ug", // Uganda
|
||||
"RWA": "rw", // Rwanda
|
||||
"BDI": "bi", // Burundi
|
||||
"SSD": "ss", // South Sudan
|
||||
"SDN": "sd", // Sudan
|
||||
"LBY": "ly", // Libya
|
||||
"TUN": "tn", // Tunisia
|
||||
"DZA": "dz", // Algeria
|
||||
"MAR": "ma", // Morocco
|
||||
"ESH": "eh", // Western Sahara
|
||||
"MRT": "mr", // Mauritania
|
||||
"MLI": "ml", // Mali
|
||||
"BFA": "bf", // Burkina Faso
|
||||
"NER": "ne", // Niger
|
||||
"TCD": "td", // Chad
|
||||
"CAF": "cf", // Central African Republic
|
||||
"CMR": "cm", // Cameroon
|
||||
"GAB": "ga", // Gabon
|
||||
"GNQ": "gq", // Equatorial Guinea
|
||||
"STP": "st", // São Tomé and Príncipe
|
||||
"GNB": "gw", // Guinea-Bissau
|
||||
"GIN": "gn", // Guinea
|
||||
"SLE": "sl", // Sierra Leone
|
||||
"LBR": "lr", // Liberia
|
||||
"CIV": "ci", // Ivory Coast
|
||||
"GHA": "gh", // Ghana
|
||||
"TGO": "tg", // Togo
|
||||
"BEN": "bj", // Benin
|
||||
"NGA": "ng", // Nigeria
|
||||
"COG": "cg", // Republic of the Congo
|
||||
"COD": "cd", // Democratic Republic of the Congo
|
||||
"AGO": "ao", // Angola
|
||||
"NAM": "na", // Namibia
|
||||
"LSO": "ls", // Lesotho
|
||||
"SWZ": "sz", // Eswatini
|
||||
}
|
||||
|
||||
// GetISOCode returns the 2-letter ISO code for a 3-letter country code
|
||||
func GetISOCode(countryCode string) string {
|
||||
if isoCode, exists := CountryCodeMapping[strings.ToUpper(countryCode)]; exists {
|
||||
return isoCode
|
||||
}
|
||||
return "" // Return empty string if not found
|
||||
}
|
||||
|
||||
// IsValidCountryCode checks if a 3-letter country code is valid
|
||||
func IsValidCountryCode(countryCode string) bool {
|
||||
_, exists := CountryCodeMapping[strings.ToUpper(countryCode)]
|
||||
return exists
|
||||
}
|
||||
|
||||
// GetCountryName returns the full country name for a 3-letter country code
|
||||
func GetCountryName(countryCode string) string {
|
||||
// This is a simplified mapping - in a real application, you might want to use a more comprehensive mapping
|
||||
countryNames := map[string]string{
|
||||
"POL": "Poland",
|
||||
"GRC": "Greece",
|
||||
"DEU": "Germany",
|
||||
"FRA": "France",
|
||||
"ITA": "Italy",
|
||||
"ESP": "Spain",
|
||||
"GBR": "United Kingdom",
|
||||
"NLD": "Netherlands",
|
||||
"BEL": "Belgium",
|
||||
"AUT": "Austria",
|
||||
"SWE": "Sweden",
|
||||
"DNK": "Denmark",
|
||||
"FIN": "Finland",
|
||||
"NOR": "Norway",
|
||||
"IRL": "Ireland",
|
||||
"PRT": "Portugal",
|
||||
"CZE": "Czech Republic",
|
||||
"SVK": "Slovakia",
|
||||
"HUN": "Hungary",
|
||||
"ROU": "Romania",
|
||||
"BGR": "Bulgaria",
|
||||
"HRV": "Croatia",
|
||||
"SVN": "Slovenia",
|
||||
"EST": "Estonia",
|
||||
"LVA": "Latvia",
|
||||
"LTU": "Lithuania",
|
||||
"LUX": "Luxembourg",
|
||||
"MLT": "Malta",
|
||||
"CYP": "Cyprus",
|
||||
"USA": "United States",
|
||||
"CAN": "Canada",
|
||||
"AUS": "Australia",
|
||||
"JPN": "Japan",
|
||||
"CHN": "China",
|
||||
"IND": "India",
|
||||
"BRA": "Brazil",
|
||||
"RUS": "Russia",
|
||||
"TUR": "Turkey",
|
||||
"UKR": "Ukraine",
|
||||
"EGY": "Egypt",
|
||||
"ZAF": "South Africa",
|
||||
"NZL": "New Zealand",
|
||||
"KOR": "South Korea",
|
||||
"THA": "Thailand",
|
||||
"SGP": "Singapore",
|
||||
"MYS": "Malaysia",
|
||||
"IDN": "Indonesia",
|
||||
"PHL": "Philippines",
|
||||
"VNM": "Vietnam",
|
||||
"CHL": "Chile",
|
||||
"ARG": "Argentina",
|
||||
"MEX": "Mexico",
|
||||
"PER": "Peru",
|
||||
"COL": "Colombia",
|
||||
"VEN": "Venezuela",
|
||||
"ECU": "Ecuador",
|
||||
"BOL": "Bolivia",
|
||||
"URY": "Uruguay",
|
||||
"PRY": "Paraguay",
|
||||
"GUY": "Guyana",
|
||||
"SUR": "Suriname",
|
||||
"ISR": "Israel",
|
||||
"SAU": "Saudi Arabia",
|
||||
"ARE": "United Arab Emirates",
|
||||
"QAT": "Qatar",
|
||||
"KWT": "Kuwait",
|
||||
"BHR": "Bahrain",
|
||||
"OMN": "Oman",
|
||||
"JOR": "Jordan",
|
||||
"LBN": "Lebanon",
|
||||
"SYR": "Syria",
|
||||
"IRQ": "Iraq",
|
||||
"IRN": "Iran",
|
||||
"AFG": "Afghanistan",
|
||||
"PAK": "Pakistan",
|
||||
"BGD": "Bangladesh",
|
||||
"LKA": "Sri Lanka",
|
||||
"MDV": "Maldives",
|
||||
"BTN": "Bhutan",
|
||||
"NPL": "Nepal",
|
||||
"MMR": "Myanmar",
|
||||
"LAO": "Laos",
|
||||
"KHM": "Cambodia",
|
||||
"BRN": "Brunei",
|
||||
"TLS": "East Timor",
|
||||
"PNG": "Papua New Guinea",
|
||||
"FJI": "Fiji",
|
||||
"TON": "Tonga",
|
||||
"WSM": "Samoa",
|
||||
"VUT": "Vanuatu",
|
||||
"SLB": "Solomon Islands",
|
||||
"KIR": "Kiribati",
|
||||
"TUV": "Tuvalu",
|
||||
"NRU": "Nauru",
|
||||
"PLW": "Palau",
|
||||
"FSM": "Federated States of Micronesia",
|
||||
"MHL": "Marshall Islands",
|
||||
"COK": "Cook Islands",
|
||||
"NIU": "Niue",
|
||||
"TKL": "Tokelau",
|
||||
"WLF": "Wallis and Futuna",
|
||||
"ASM": "American Samoa",
|
||||
"GUM": "Guam",
|
||||
"MNP": "Northern Mariana Islands",
|
||||
"PRI": "Puerto Rico",
|
||||
"VIR": "U.S. Virgin Islands",
|
||||
"BHS": "Bahamas",
|
||||
"BLZ": "Belize",
|
||||
"CRI": "Costa Rica",
|
||||
"GTM": "Guatemala",
|
||||
"HND": "Honduras",
|
||||
"NIC": "Nicaragua",
|
||||
"PAN": "Panama",
|
||||
"SLV": "El Salvador",
|
||||
"JAM": "Jamaica",
|
||||
"HTI": "Haiti",
|
||||
"DOM": "Dominican Republic",
|
||||
"CUB": "Cuba",
|
||||
"TTO": "Trinidad and Tobago",
|
||||
"BRB": "Barbados",
|
||||
"LCA": "Saint Lucia",
|
||||
"VCT": "Saint Vincent and the Grenadines",
|
||||
"GRD": "Grenada",
|
||||
"ATG": "Antigua and Barbuda",
|
||||
"DMA": "Dominica",
|
||||
"KNA": "Saint Kitts and Nevis",
|
||||
"BWA": "Botswana",
|
||||
"ZWE": "Zimbabwe",
|
||||
"ZMB": "Zambia",
|
||||
"MWI": "Malawi",
|
||||
"MOZ": "Mozambique",
|
||||
"MDG": "Madagascar",
|
||||
"MUS": "Mauritius",
|
||||
"SYC": "Seychelles",
|
||||
"COM": "Comoros",
|
||||
"DJI": "Djibouti",
|
||||
"ERI": "Eritrea",
|
||||
"ETH": "Ethiopia",
|
||||
"KEN": "Kenya",
|
||||
"TZA": "Tanzania",
|
||||
"UGA": "Uganda",
|
||||
"RWA": "Rwanda",
|
||||
"BDI": "Burundi",
|
||||
"SSD": "South Sudan",
|
||||
"SDN": "Sudan",
|
||||
"LBY": "Libya",
|
||||
"TUN": "Tunisia",
|
||||
"DZA": "Algeria",
|
||||
"MAR": "Morocco",
|
||||
"ESH": "Western Sahara",
|
||||
"MRT": "Mauritania",
|
||||
"MLI": "Mali",
|
||||
"BFA": "Burkina Faso",
|
||||
"NER": "Niger",
|
||||
"TCD": "Chad",
|
||||
"CAF": "Central African Republic",
|
||||
"CMR": "Cameroon",
|
||||
"GAB": "Gabon",
|
||||
"GNQ": "Equatorial Guinea",
|
||||
"STP": "São Tomé and Príncipe",
|
||||
"GNB": "Guinea-Bissau",
|
||||
"GIN": "Guinea",
|
||||
"SLE": "Sierra Leone",
|
||||
"LBR": "Liberia",
|
||||
"CIV": "Ivory Coast",
|
||||
"GHA": "Ghana",
|
||||
"TGO": "Togo",
|
||||
"BEN": "Benin",
|
||||
"NGA": "Nigeria",
|
||||
"COG": "Republic of the Congo",
|
||||
"COD": "Democratic Republic of the Congo",
|
||||
"AGO": "Angola",
|
||||
"NAM": "Namibia",
|
||||
"LSO": "Lesotho",
|
||||
"SWZ": "Eswatini",
|
||||
}
|
||||
|
||||
if name, exists := countryNames[strings.ToUpper(countryCode)]; exists {
|
||||
return name
|
||||
}
|
||||
return countryCode // Return the code itself if name not found
|
||||
}
|
||||
|
||||
// GetFlagAsset returns the flag SVG asset from filesystem
|
||||
func GetFlagAsset(flagsPath, isoCode string) ([]byte, error) {
|
||||
flagPath := filepath.Join(flagsPath, strings.ToLower(isoCode)+".svg")
|
||||
|
||||
f, err := os.ReadFile(flagPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read flag asset, %v", flagPath)
|
||||
}
|
||||
|
||||
return f, nil
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package assets
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"tm/pkg/logger"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
// Handler handles HTTP requests for flag operations
|
||||
type Handler struct {
|
||||
service Service
|
||||
logger logger.Logger
|
||||
}
|
||||
|
||||
// NewHandler creates a new flag handler
|
||||
func NewHandler(service Service, logger logger.Logger) *Handler {
|
||||
return &Handler{
|
||||
service: service,
|
||||
logger: logger,
|
||||
}
|
||||
}
|
||||
|
||||
// **************************** PUBLIC ENDPOINTS ****************************
|
||||
// GetFlagSVG returns only the SVG content of a flag
|
||||
// @Summary Get flag SVG
|
||||
// @Description Retrieve only the SVG content of a country flag by its 3-letter country code
|
||||
// @Tags Flags
|
||||
// @Accept json
|
||||
// @Produce image/svg+xml
|
||||
// @Param country_code path string true "3-letter country code (e.g., POL, GRC)"
|
||||
// @Success 200 {string} string "SVG content"
|
||||
// @Router /api/v1//{country_code} [get]
|
||||
func (h *Handler) GetFlagSVG(c echo.Context) error {
|
||||
countryCode := c.Param("country_code")
|
||||
|
||||
svgData := h.service.GetFlagSVG(c.Request().Context(), countryCode)
|
||||
|
||||
c.Response().Header().Set("Content-Type", "image/svg+xml")
|
||||
c.Response().Header().Set("Cache-Control", "public, max-age=86400") // Cache for 24 hours
|
||||
return c.String(http.StatusOK, svgData)
|
||||
}
|
||||
|
||||
// **************************** ADMIN ENDPOINTS ****************************
|
||||
|
||||
// AdminGetFlag returns a flag by country code (Admin)
|
||||
// @Summary Get flag by country code (Admin)
|
||||
// @Description Retrieve a country flag by its 3-letter country code for admin panel
|
||||
// @Tags Admin Flags
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param country_code path string true "3-letter country code (e.g., POL, GRC)"
|
||||
// @Success 200 {string} string "SVG content"
|
||||
// @Security BearerAuth
|
||||
// @Router /admin/v1/flags/{country_code} [get]
|
||||
func (h *Handler) AdminGetFlagSVG(c echo.Context) error {
|
||||
countryCode := c.Param("country_code")
|
||||
|
||||
svgData := h.service.GetFlagSVG(c.Request().Context(), countryCode)
|
||||
|
||||
c.Response().Header().Set("Content-Type", "image/svg+xml")
|
||||
c.Response().Header().Set("Cache-Control", "public, max-age=86400") // Cache for 24 hours
|
||||
return c.String(http.StatusOK, svgData)
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package assets
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"tm/pkg/logger"
|
||||
)
|
||||
|
||||
// Service defines business logic for flag operations
|
||||
type Service interface {
|
||||
// Get flag as SVG content only
|
||||
GetFlagSVG(ctx context.Context, countryCode string) string
|
||||
}
|
||||
|
||||
// flagService implements the Service interface
|
||||
type flagService struct {
|
||||
logger logger.Logger
|
||||
flagsPath string
|
||||
}
|
||||
|
||||
// NewFlagService creates a new flag service
|
||||
func NewFlagService(logger logger.Logger, flagsPath string) Service {
|
||||
return &flagService{
|
||||
logger: logger,
|
||||
flagsPath: flagsPath,
|
||||
}
|
||||
}
|
||||
|
||||
// GetFlagSVG retrieves only the SVG content for a flag
|
||||
func (s *flagService) GetFlagSVG(ctx context.Context, countryCode string) string {
|
||||
s.logger.Info("Getting flag SVG for country", map[string]interface{}{
|
||||
"country_code": countryCode,
|
||||
})
|
||||
|
||||
// Normalize country code
|
||||
countryCode = strings.ToUpper(countryCode)
|
||||
|
||||
defaultFlag, err := GetFlagAsset(s.flagsPath, "eu")
|
||||
if err != nil {
|
||||
s.logger.Error("Failed to get default flag SVG", map[string]interface{}{
|
||||
"country_code": countryCode,
|
||||
"error": err.Error(),
|
||||
})
|
||||
return s.getDefaultFlag()
|
||||
}
|
||||
|
||||
// Get ISO code
|
||||
isoCode := GetISOCode(countryCode)
|
||||
|
||||
// Get SVG data
|
||||
svgData, err := s.getFlagSVG(isoCode)
|
||||
if err != nil {
|
||||
s.logger.Error("Failed to get flag SVG", map[string]interface{}{
|
||||
"country_code": countryCode,
|
||||
"iso_code": isoCode,
|
||||
"error": err.Error(),
|
||||
})
|
||||
return string(defaultFlag)
|
||||
}
|
||||
|
||||
s.logger.Info("Successfully retrieved flag SVG", map[string]interface{}{
|
||||
"country_code": countryCode,
|
||||
"iso_code": isoCode,
|
||||
})
|
||||
|
||||
return svgData
|
||||
}
|
||||
|
||||
// getFlagSVG retrieves the SVG content for a given ISO code
|
||||
func (s *flagService) getFlagSVG(isoCode string) (string, error) {
|
||||
// Try to get from filesystem
|
||||
svgData, err := GetFlagAsset(s.flagsPath, isoCode)
|
||||
if err == nil {
|
||||
return string(svgData), nil
|
||||
}
|
||||
|
||||
// If not found in filesystem, return error
|
||||
s.logger.Warn("Flag not found in filesystem", map[string]interface{}{
|
||||
"iso_code": isoCode,
|
||||
"path": s.flagsPath,
|
||||
})
|
||||
|
||||
return "", fmt.Errorf("failed to get flag SVG, %v from %v", isoCode, s.flagsPath)
|
||||
}
|
||||
|
||||
// getDefaultFlag returns a default flag SVG when all fallbacks fail
|
||||
func (s *flagService) getDefaultFlag() string {
|
||||
// Return a simple default flag SVG
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30">
|
||||
<rect width="60" height="30" fill="#012169"/>
|
||||
<text x="30" y="20" text-anchor="middle" fill="white" font-family="Arial" font-size="12">EU</text>
|
||||
</svg>`
|
||||
}
|
||||
Reference in New Issue
Block a user