Skip to content

Commit

Permalink
Add multi-language support
Browse files Browse the repository at this point in the history
  • Loading branch information
bclswl0827 committed Sep 5, 2023
1 parent ca71e8f commit 7db36d6
Show file tree
Hide file tree
Showing 93 changed files with 2,406 additions and 627 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.1.2p
v2.1.3p
2 changes: 1 addition & 1 deletion app/history/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (h *History) RegisterModule(rg *gin.RouterGroup, options *app.ServerOptions

switch binding.Format {
case "json":
response.Message(c, "筛选出如下波形数据", data)
response.Message(c, "The specified waveform data was successfully filtered", data)
return
case "sac":
fileName, dataBytes, err := GetSACBytes(data, binding.Channel, options)
Expand Down
2 changes: 1 addition & 1 deletion app/station/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import (

func (s *Station) RegisterModule(rg *gin.RouterGroup, options *app.ServerOptions) {
rg.GET("/station", func(c *gin.Context) {
response.Message(c, "成功取得测站状态", getStation(options.FeatureOptions))
response.Message(c, "Successfully read station status", getStation(options.FeatureOptions))
})
}
4 changes: 2 additions & 2 deletions app/trace/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (t *Trace) RegisterModule(rg *gin.RouterGroup, options *app.ServerOptions)
})
}

response.Message(c, "成功取得可用数据源列表", list)
response.Message(c, "Successfully read available data source list", list)
return
}

Expand All @@ -57,7 +57,7 @@ func (t *Trace) RegisterModule(rg *gin.RouterGroup, options *app.ServerOptions)
}

sortByTimestamp(events)
response.Message(c, "成功取得地震列表数据", events)
response.Message(c, "Successfully read the list of earthquake events", events)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func main() {

// Initialize global status
var status publisher.Status
publisher.Init(&conf, &status)
publisher.Initialize(&conf, &status)

// Register features
featureOptions := &feature.FeatureOptions{
Expand Down
4 changes: 2 additions & 2 deletions feature/geophone/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package geophone

import "time"

const MODULE string = "geophone"

const (
// READY_THRESHOLD should be smaller than 1 second
READY_THRESHOLD time.Duration = 900 * time.Millisecond
// TIMEOUT_THRESHOLD should be greater than 1 second
TIMEOUT_THRESHOLD time.Duration = 3 * time.Second
)

const MODULE string = "geophone"

type Geophone struct{}

type Packet struct {
Expand Down
31 changes: 17 additions & 14 deletions frontend/dist/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"files": {
"main.css": "/static/css/main.e0ca7255.css",
"main.js": "/static/js/main.bc4ef9f8.js",
"main.css": "/static/css/main.6306a3a5.css",
"main.js": "/static/js/main.485df794.js",
"static/css/10.525e2941.chunk.css": "/static/css/10.525e2941.chunk.css",
"static/js/10.f9481729.chunk.js": "/static/js/10.f9481729.chunk.js",
"static/js/311.55339514.chunk.js": "/static/js/311.55339514.chunk.js",
"static/js/231.0e5fc9dd.chunk.js": "/static/js/231.0e5fc9dd.chunk.js",
"static/js/251.562e195e.chunk.js": "/static/js/251.562e195e.chunk.js",
"static/js/33.1eaa95e6.chunk.js": "/static/js/33.1eaa95e6.chunk.js",
"static/js/10.acbbbcaf.chunk.js": "/static/js/10.acbbbcaf.chunk.js",
"static/js/311.c9e754c7.chunk.js": "/static/js/311.c9e754c7.chunk.js",
"static/js/923.c7bbfdce.chunk.js": "/static/js/923.c7bbfdce.chunk.js",
"static/js/419.50ce82ce.chunk.js": "/static/js/419.50ce82ce.chunk.js",
"static/js/377.309ea121.chunk.js": "/static/js/377.309ea121.chunk.js",
"static/js/493.11396ed4.chunk.js": "/static/js/493.11396ed4.chunk.js",
"static/js/59.a77c052b.chunk.js": "/static/js/59.a77c052b.chunk.js",
"static/js/954.4529ea89.chunk.js": "/static/js/954.4529ea89.chunk.js",
"static/js/953.91002b60.chunk.js": "/static/js/953.91002b60.chunk.js",
"static/js/822.f9927c0b.chunk.js": "/static/js/822.f9927c0b.chunk.js",
"static/js/798.662b08bc.chunk.js": "/static/js/798.662b08bc.chunk.js",
"static/js/730.84585ee7.chunk.js": "/static/js/730.84585ee7.chunk.js",
"static/js/528.f1bce262.chunk.js": "/static/js/528.f1bce262.chunk.js",
"static/js/822.ae40dac1.chunk.js": "/static/js/822.ae40dac1.chunk.js",
"static/js/439.c615bad3.chunk.js": "/static/js/439.c615bad3.chunk.js",
"static/js/730.9ab92959.chunk.js": "/static/js/730.9ab92959.chunk.js",
"static/media/gear-solid.svg": "/static/media/gear-solid.bf34f9d52ff44a67baec8a0d4220d3a3.svg",
"static/media/bug-solid.svg": "/static/media/bug-solid.7f781f9ddd35c29f11111e36602dcc87.svg",
"static/media/earth-americas-solid.svg": "/static/media/earth-americas-solid.4105ee3951f1c7ac60331fccafc17c1f.svg",
"static/media/link-solid.svg": "/static/media/link-solid.49819f951200a220d9839699fbccd8de.svg",
"static/media/link-slash-solid.svg": "/static/media/link-slash-solid.7893b9a51ad07ceedeb88c9649c58439.svg",
"static/media/maximize-solid.svg": "/static/media/maximize-solid.daad92d8ce4bd4922c4d8d2bc5ee889f.svg",
Expand All @@ -34,10 +36,11 @@
"static/media/clock-solid.svg": "/static/media/clock-solid.23025348eaec720a2439930b37d677ee.svg",
"static/media/angle-right-solid.svg": "/static/media/angle-right-solid.cda594ece7082478d17a05a0a0e148f5.svg",
"static/media/location-dot-solid.svg": "/static/media/location-dot-solid.763794361437464c10451de38cd290f7.svg",
"index.html": "/index.html"
"index.html": "/index.html",
"static/media/getFetch.cjs": "/static/media/getFetch.40f37ddea2378391108f.cjs"
},
"entrypoints": [
"static/css/main.e0ca7255.css",
"static/js/main.bc4ef9f8.js"
"static/css/main.6306a3a5.css",
"static/js/main.485df794.js"
]
}
226 changes: 226 additions & 0 deletions frontend/dist/i18n/en-US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
{
"config": {
"global": {
"name": "Observer",
"author": "Project ES",
"title": "Observer Panel",
"description": "Constructing Realtime Seismic Network Ambitiously."
},
"menu": {
"title": "Panel Menu",
"list": {
"index": "Station Status",
"realtime": "Realtime Waveform",
"history": "Historical Waveform",
"setting": "Panel Settings"
}
},
"router": {
"error": "Error occurred",
"index": "Station Status",
"realtime": "Realtime Waveform",
"history": "Historical Waveform",
"setting": "Panel Settings"
}
},
"components": {
"chart": {
"reset_zoom": "Reset Zoom",
"reset_zoom_title": "Reset Zoom to Default"
}
},
"views": {
"home": {
"banner": {
"warning": {
"label": "Connecting to Server",
"text": "Please wait..."
},
"success": {
"label": "{{ station }} Connected",
"text": "Server Uptime: {{ uptime }} seconds\nServer Architecture: {{ arch }}/{{ os }}\nUUID: {{ uuid }}"
},
"error": {
"label": "Connection Failed",
"text": "Unable to connect to the server. Please try refreshing the page or changing your network."
}
},
"areas": {
"cpu": {
"label": "CPU Usage",
"text": "Current usage: {{ usage }}%"
},
"memory": {
"label": "Memory Usage",
"text": "Current usage: {{ usage }}%"
}
},
"map": {
"area": {
"label": "Station Location",
"text": "Longitude: {{ longitude }} °\nLatitude: {{ latitude }} °\nElevation: {{ altitude }} m"
}
},
"labels": {
"messages": {
"label": "Decoded Messages",
"unit": "messages"
},
"errors": {
"label": "Frame Errors",
"unit": "errors"
},
"pushed": {
"label": "Pushed Messages",
"unit": "messages"
},
"failures": {
"label": "Push Failures",
"unit": "failures"
},
"queued": {
"label": "Queued Messages",
"unit": "messages"
},
"offset": {
"label": "System Time Offset",
"unit": "seconds"
}
}
},
"realtime": {
"banner": {
"warning": {
"label": "Connecting to Server",
"text": "Please wait..."
},
"success": {
"label": "Current Sampling Rate {{ sampleRate }} Sps",
"text": "Current Seismic Scale {{ scale }}\nData updated at {{ time }}"
},
"error": {
"label": "Connection Failed",
"text": "Attempting to reconnect. If unable to connect to the server for an extended period, please refresh the page or change your network."
}
},
"areas": {
"ehz": {
"label": "EHZ Channel Waveform Count",
"text": "PGA: {{ pga }} gal\nPGV: {{ pgv }} cm/s\nIntensity: {{ intensity }}"
},
"ehe": {
"label": "EHE Channel Waveform Count",
"text": "PGA: {{ pga }} gal\nPGV: {{ pgv }} cm/s\nIntensity: {{ intensity }}"
},
"ehn": {
"label": "EHN Channel Waveform Count",
"text": "PGA: {{ pga }} gal\nPGV: {{ pgv }} cm/s\nIntensity: {{ intensity }}"
}
},
"toasts": {
"websocket_connected": "WebSocket connection established",
"fetch_metadata_error": "An error occurred while retrieving station information. The functionality is not available."
}
},
"history": {
"modals": {
"choose_event": {
"title": "Select an Earthquake Event"
}
},
"selects": {
"choose_channel": {
"title": "Select Channels to Export"
},
"choose_source": {
"title": "Select Earthquake Data Source"
}
},
"areas": {
"ehz": {
"label": "EHZ Channel Waveform Count"
},
"ehe": {
"label": "EHE Channel Waveform Count"
},
"ehn": {
"label": "EHN Channel Waveform Count"
}
},
"cards": {
"query_history": "Historical Query",
"analyse_history": "Data Analysis"
},
"buttons": {
"query_waveform": "Retrieve Waveforms",
"query_sac_file": "Download Data",
"query_source": "Event Lookup"
},
"labels": {
"ehz_pga": {
"label": "EHZ Peak Acc.",
"unit": "gal"
},
"ehz_intensity": {
"label": "EHZ Peak Intensity",
"unit": ""
},
"ehe_pga": {
"label": "EHE Peak Acc.",
"unit": "gal"
},
"ehe_intensity": {
"label": "EHE Peak Intensity",
"unit": ""
},
"ehn_pga": {
"label": "EHN Peak Acc.",
"unit": "gal"
},
"ehn_intensity": {
"label": "EHN Peak Intensity",
"unit": ""
}
},
"time_pickers": {
"start_time": "Select Start Time",
"end_time": "Select End Time"
},
"toasts": {
"time_error": "Please select the correct time range",
"metadata_error": "An error occurred while retrieving station information. The functionality is not available.",
"is_exporting_sac": "Exporting SAC format waveforms, please wait...",
"export_sac_success": "SAC format waveform data export successful",
"export_sac_error": "SAC format waveform data export failed",
"is_fetching_source": "Fetching event data source, please wait...",
"fetch_source_success": "Event data source retrieval successful",
"fetch_source_error": "Event data source retrieval failed",
"is_fetching_events": "Querying earthquake event data, please wait...",
"fetch_events_success": "Earthquake event query successful",
"fetch_events_error": "Earthquake event query failed",
"is_fetching_waveform": "Querying historical waveform data, please wait...",
"fetch_waveform_success": "Historical waveform data query successful",
"fetch_waveform_error": "Historical waveform data query failed"
}
},
"setting": {
"buttons": {
"select_scale": "Select Seismic Scale",
"purge_cache": "Clear Application Cache"
},
"cards": {
"select_scale": "Seismic Scale",
"purge_cache": "Reset Application"
},
"selects": {
"choose_scale": {
"title": "Select Seismic Scale"
}
},
"toasts": {
"cache_purged": "Application cache cleared, page will refresh shortly",
"scale_changed": "Seismic scale changed to {{ scale }}"
}
}
}
}
Loading

0 comments on commit 7db36d6

Please sign in to comment.